Files
2026-06-04 11:42:34 +02:00

1282 lines
49 KiB
C#

using System;
using System.Runtime.InteropServices;
using System.Threading;
namespace System.Globalization
{
/// <summary>Defines how numeric values are formatted and displayed, depending on the culture.</summary>
// Token: 0x02000192 RID: 402
[ComVisible(true)]
[Serializable]
public sealed class NumberFormatInfo : ICloneable, IFormatProvider
{
// Token: 0x06001420 RID: 5152 RVA: 0x0004DB30 File Offset: 0x0004BD30
internal NumberFormatInfo(int lcid, bool read_only)
{
this.isReadOnly = read_only;
if (lcid != 127)
{
lcid = 127;
}
int num = lcid;
if (num == 127)
{
this.isReadOnly = false;
this.currencyDecimalDigits = 2;
this.currencyDecimalSeparator = ".";
this.currencyGroupSeparator = ",";
this.currencyGroupSizes = new int[] { 3 };
this.currencyNegativePattern = 0;
this.currencyPositivePattern = 0;
this.currencySymbol = "$";
this.nanSymbol = "NaN";
this.negativeInfinitySymbol = "-Infinity";
this.negativeSign = "-";
this.numberDecimalDigits = 2;
this.numberDecimalSeparator = ".";
this.numberGroupSeparator = ",";
this.numberGroupSizes = new int[] { 3 };
this.numberNegativePattern = 1;
this.percentDecimalDigits = 2;
this.percentDecimalSeparator = ".";
this.percentGroupSeparator = ",";
this.percentGroupSizes = new int[] { 3 };
this.percentNegativePattern = 0;
this.percentPositivePattern = 0;
this.percentSymbol = "%";
this.perMilleSymbol = "‰";
this.positiveInfinitySymbol = "Infinity";
this.positiveSign = "+";
}
}
// Token: 0x06001421 RID: 5153 RVA: 0x0004DC9C File Offset: 0x0004BE9C
internal NumberFormatInfo(bool read_only)
: this(127, read_only)
{
}
/// <summary>Initializes a new writable instance of the <see cref="T:System.Globalization.NumberFormatInfo" /> class that is culture-independent (invariant).</summary>
// Token: 0x06001422 RID: 5154 RVA: 0x0004DCA8 File Offset: 0x0004BEA8
public NumberFormatInfo()
: this(false)
{
}
// Token: 0x06001424 RID: 5156 RVA: 0x0004DD20 File Offset: 0x0004BF20
private void InitPatterns()
{
string[] array = this.decimalFormats.Split(new char[] { ';' }, 2);
string[] array2;
if (array.Length == 2)
{
array2 = array[0].Split(new char[] { '.' }, 2);
if (array2.Length == 2)
{
this.numberDecimalDigits = 0;
for (int i = 0; i < array2[1].Length; i++)
{
if (array2[1][i] != this.digitPattern[0])
{
break;
}
this.numberDecimalDigits++;
}
string[] array3 = array2[0].Split(new char[] { ',' });
if (array3.Length > 1)
{
this.numberGroupSizes = new int[array3.Length - 1];
for (int j = 0; j < this.numberGroupSizes.Length; j++)
{
string text = array3[j + 1];
this.numberGroupSizes[j] = text.Length;
}
}
else
{
this.numberGroupSizes = new int[1];
}
if (array[1].StartsWith("(") && array[1].EndsWith(")"))
{
this.numberNegativePattern = 0;
}
else if (array[1].StartsWith("- "))
{
this.numberNegativePattern = 2;
}
else if (array[1].StartsWith("-"))
{
this.numberNegativePattern = 1;
}
else if (array[1].EndsWith(" -"))
{
this.numberNegativePattern = 4;
}
else if (array[1].EndsWith("-"))
{
this.numberNegativePattern = 3;
}
else
{
this.numberNegativePattern = 1;
}
}
}
array = this.currencyFormats.Split(new char[] { ';' }, 2);
if (array.Length == 2)
{
array2 = array[0].Split(new char[] { '.' }, 2);
if (array2.Length == 2)
{
this.currencyDecimalDigits = 0;
for (int k = 0; k < array2[1].Length; k++)
{
if (array2[1][k] != this.zeroPattern[0])
{
break;
}
this.currencyDecimalDigits++;
}
string[] array3 = array2[0].Split(new char[] { ',' });
if (array3.Length > 1)
{
this.currencyGroupSizes = new int[array3.Length - 1];
for (int l = 0; l < this.currencyGroupSizes.Length; l++)
{
string text2 = array3[l + 1];
this.currencyGroupSizes[l] = text2.Length;
}
}
else
{
this.currencyGroupSizes = new int[1];
}
if (array[1].StartsWith("(¤ ") && array[1].EndsWith(")"))
{
this.currencyNegativePattern = 14;
}
else if (array[1].StartsWith("(¤") && array[1].EndsWith(")"))
{
this.currencyNegativePattern = 0;
}
else if (array[1].StartsWith("¤ ") && array[1].EndsWith("-"))
{
this.currencyNegativePattern = 11;
}
else if (array[1].StartsWith("¤") && array[1].EndsWith("-"))
{
this.currencyNegativePattern = 3;
}
else if (array[1].StartsWith("(") && array[1].EndsWith(" ¤"))
{
this.currencyNegativePattern = 15;
}
else if (array[1].StartsWith("(") && array[1].EndsWith("¤"))
{
this.currencyNegativePattern = 4;
}
else if (array[1].StartsWith("-") && array[1].EndsWith(" ¤"))
{
this.currencyNegativePattern = 8;
}
else if (array[1].StartsWith("-") && array[1].EndsWith("¤"))
{
this.currencyNegativePattern = 5;
}
else if (array[1].StartsWith("-¤ "))
{
this.currencyNegativePattern = 9;
}
else if (array[1].StartsWith("-¤"))
{
this.currencyNegativePattern = 1;
}
else if (array[1].StartsWith("¤ -"))
{
this.currencyNegativePattern = 12;
}
else if (array[1].StartsWith("¤-"))
{
this.currencyNegativePattern = 2;
}
else if (array[1].EndsWith(" ¤-"))
{
this.currencyNegativePattern = 10;
}
else if (array[1].EndsWith("¤-"))
{
this.currencyNegativePattern = 7;
}
else if (array[1].EndsWith("- ¤"))
{
this.currencyNegativePattern = 13;
}
else if (array[1].EndsWith("-¤"))
{
this.currencyNegativePattern = 6;
}
else
{
this.currencyNegativePattern = 0;
}
if (array[0].StartsWith("¤ "))
{
this.currencyPositivePattern = 2;
}
else if (array[0].StartsWith("¤"))
{
this.currencyPositivePattern = 0;
}
else if (array[0].EndsWith(" ¤"))
{
this.currencyPositivePattern = 3;
}
else if (array[0].EndsWith("¤"))
{
this.currencyPositivePattern = 1;
}
else
{
this.currencyPositivePattern = 0;
}
}
}
if (this.percentFormats.StartsWith("%"))
{
this.percentPositivePattern = 2;
this.percentNegativePattern = 2;
}
else if (this.percentFormats.EndsWith(" %"))
{
this.percentPositivePattern = 0;
this.percentNegativePattern = 0;
}
else if (this.percentFormats.EndsWith("%"))
{
this.percentPositivePattern = 1;
this.percentNegativePattern = 1;
}
else
{
this.percentPositivePattern = 0;
this.percentNegativePattern = 0;
}
array2 = this.percentFormats.Split(new char[] { '.' }, 2);
if (array2.Length == 2)
{
this.percentDecimalDigits = 0;
for (int m = 0; m < array2[1].Length; m++)
{
if (array2[1][m] != this.digitPattern[0])
{
break;
}
this.percentDecimalDigits++;
}
string[] array3 = array2[0].Split(new char[] { ',' });
if (array3.Length > 1)
{
this.percentGroupSizes = new int[array3.Length - 1];
for (int n = 0; n < this.percentGroupSizes.Length; n++)
{
string text3 = array3[n + 1];
this.percentGroupSizes[n] = text3.Length;
}
}
else
{
this.percentGroupSizes = new int[1];
}
}
}
/// <summary>Gets or sets the number of decimal places to use in currency values.</summary>
/// <returns>The number of decimal places to use in currency values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 2.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 99. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000374 RID: 884
// (get) Token: 0x06001425 RID: 5157 RVA: 0x0004E458 File Offset: 0x0004C658
// (set) Token: 0x06001426 RID: 5158 RVA: 0x0004E460 File Offset: 0x0004C660
public int CurrencyDecimalDigits
{
get
{
return this.currencyDecimalDigits;
}
set
{
if (value < 0 || value > 99)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 99");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.currencyDecimalDigits = value;
}
}
/// <summary>Gets or sets the string to use as the decimal separator in currency values.</summary>
/// <returns>The string to use as the decimal separator in currency values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is ".".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
/// <exception cref="T:System.ArgumentException">The property is being set to an empty string.</exception>
// Token: 0x17000375 RID: 885
// (get) Token: 0x06001427 RID: 5159 RVA: 0x0004E49C File Offset: 0x0004C69C
// (set) Token: 0x06001428 RID: 5160 RVA: 0x0004E4A4 File Offset: 0x0004C6A4
public string CurrencyDecimalSeparator
{
get
{
return this.currencyDecimalSeparator;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.currencyDecimalSeparator = value;
}
}
/// <summary>Gets or sets the string that separates groups of digits to the left of the decimal in currency values.</summary>
/// <returns>The string that separates groups of digits to the left of the decimal in currency values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is ",".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000376 RID: 886
// (get) Token: 0x06001429 RID: 5161 RVA: 0x0004E4E0 File Offset: 0x0004C6E0
// (set) Token: 0x0600142A RID: 5162 RVA: 0x0004E4E8 File Offset: 0x0004C6E8
public string CurrencyGroupSeparator
{
get
{
return this.currencyGroupSeparator;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.currencyGroupSeparator = value;
}
}
/// <summary>Gets or sets the number of digits in each group to the left of the decimal in currency values.</summary>
/// <returns>The number of digits in each group to the left of the decimal in currency values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is a one-dimensional array with only one element, which is set to 3.</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.ArgumentException">The property is being set and the array contains an entry that is less than 0 or greater than 9.-or- The property is being set and the array contains an entry, other than the last entry, that is set to 0. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000377 RID: 887
// (get) Token: 0x0600142B RID: 5163 RVA: 0x0004E524 File Offset: 0x0004C724
// (set) Token: 0x0600142C RID: 5164 RVA: 0x0004E538 File Offset: 0x0004C738
public int[] CurrencyGroupSizes
{
get
{
return (int[])this.RawCurrencyGroupSizes.Clone();
}
set
{
this.RawCurrencyGroupSizes = value;
}
}
// Token: 0x17000378 RID: 888
// (get) Token: 0x0600142D RID: 5165 RVA: 0x0004E544 File Offset: 0x0004C744
// (set) Token: 0x0600142E RID: 5166 RVA: 0x0004E54C File Offset: 0x0004C74C
internal int[] RawCurrencyGroupSizes
{
get
{
return this.currencyGroupSizes;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
if (value.Length == 0)
{
this.currencyGroupSizes = new int[0];
return;
}
int num = value.Length - 1;
for (int i = 0; i < num; i++)
{
if (value[i] < 1 || value[i] > 9)
{
throw new ArgumentOutOfRangeException("One of the elements in the array specified is not between 1 and 9");
}
}
if (value[num] < 0 || value[num] > 9)
{
throw new ArgumentOutOfRangeException("Last element in the array specified is not between 0 and 9");
}
this.currencyGroupSizes = (int[])value.Clone();
}
}
/// <summary>Gets or sets the format pattern for negative currency values.</summary>
/// <returns>The format pattern for negative currency values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 0, which represents "($n)", where "$" is the <see cref="P:System.Globalization.NumberFormatInfo.CurrencySymbol" /> and <paramref name="n" /> is a number.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 15. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000379 RID: 889
// (get) Token: 0x0600142F RID: 5167 RVA: 0x0004E5FC File Offset: 0x0004C7FC
// (set) Token: 0x06001430 RID: 5168 RVA: 0x0004E604 File Offset: 0x0004C804
public int CurrencyNegativePattern
{
get
{
return this.currencyNegativePattern;
}
set
{
if (value < 0 || value > 15)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 15");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.currencyNegativePattern = value;
}
}
/// <summary>Gets or sets the format pattern for positive currency values.</summary>
/// <returns>The format pattern for positive currency values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 0, which represents "$n", where "$" is the <see cref="P:System.Globalization.NumberFormatInfo.CurrencySymbol" /> and <paramref name="n" /> is a number.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 3. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700037A RID: 890
// (get) Token: 0x06001431 RID: 5169 RVA: 0x0004E640 File Offset: 0x0004C840
// (set) Token: 0x06001432 RID: 5170 RVA: 0x0004E648 File Offset: 0x0004C848
public int CurrencyPositivePattern
{
get
{
return this.currencyPositivePattern;
}
set
{
if (value < 0 || value > 3)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 3");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.currencyPositivePattern = value;
}
}
/// <summary>Gets or sets the string to use as the currency symbol.</summary>
/// <returns>The string to use as the currency symbol. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "¤".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700037B RID: 891
// (get) Token: 0x06001433 RID: 5171 RVA: 0x0004E68C File Offset: 0x0004C88C
// (set) Token: 0x06001434 RID: 5172 RVA: 0x0004E694 File Offset: 0x0004C894
public string CurrencySymbol
{
get
{
return this.currencySymbol;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.currencySymbol = value;
}
}
/// <summary>Gets a read-only <see cref="T:System.Globalization.NumberFormatInfo" /> that formats values based on the current culture.</summary>
/// <returns>A read-only <see cref="T:System.Globalization.NumberFormatInfo" /> based on the <see cref="T:System.Globalization.CultureInfo" /> of the current thread.</returns>
// Token: 0x1700037C RID: 892
// (get) Token: 0x06001435 RID: 5173 RVA: 0x0004E6D0 File Offset: 0x0004C8D0
public static NumberFormatInfo CurrentInfo
{
get
{
NumberFormatInfo numberFormat = Thread.CurrentThread.CurrentCulture.NumberFormat;
numberFormat.isReadOnly = true;
return numberFormat;
}
}
/// <summary>Gets the default read-only <see cref="T:System.Globalization.NumberFormatInfo" /> that is culture-independent (invariant).</summary>
/// <returns>The default read-only <see cref="T:System.Globalization.NumberFormatInfo" /> that is culture-independent (invariant).</returns>
// Token: 0x1700037D RID: 893
// (get) Token: 0x06001436 RID: 5174 RVA: 0x0004E6F8 File Offset: 0x0004C8F8
public static NumberFormatInfo InvariantInfo
{
get
{
return new NumberFormatInfo
{
NumberNegativePattern = 1,
isReadOnly = true
};
}
}
/// <summary>Gets a value indicating whether the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only.</summary>
/// <returns>true if the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only; otherwise, false.</returns>
// Token: 0x1700037E RID: 894
// (get) Token: 0x06001437 RID: 5175 RVA: 0x0004E71C File Offset: 0x0004C91C
public bool IsReadOnly
{
get
{
return this.isReadOnly;
}
}
/// <summary>Gets or sets the string that represents the IEEE NaN (not a number) value.</summary>
/// <returns>The string that represents the IEEE NaN (not a number) value. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "NaN".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700037F RID: 895
// (get) Token: 0x06001438 RID: 5176 RVA: 0x0004E724 File Offset: 0x0004C924
// (set) Token: 0x06001439 RID: 5177 RVA: 0x0004E72C File Offset: 0x0004C92C
public string NaNSymbol
{
get
{
return this.nanSymbol;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.nanSymbol = value;
}
}
/// <summary>Gets or sets the string that represents negative infinity.</summary>
/// <returns>The string that represents negative infinity. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "-Infinity".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000380 RID: 896
// (get) Token: 0x0600143A RID: 5178 RVA: 0x0004E768 File Offset: 0x0004C968
// (set) Token: 0x0600143B RID: 5179 RVA: 0x0004E770 File Offset: 0x0004C970
public string NegativeInfinitySymbol
{
get
{
return this.negativeInfinitySymbol;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.negativeInfinitySymbol = value;
}
}
/// <summary>Gets or sets the string that denotes that the associated number is negative.</summary>
/// <returns>The string that denotes that the associated number is negative. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "-".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000381 RID: 897
// (get) Token: 0x0600143C RID: 5180 RVA: 0x0004E7AC File Offset: 0x0004C9AC
// (set) Token: 0x0600143D RID: 5181 RVA: 0x0004E7B4 File Offset: 0x0004C9B4
public string NegativeSign
{
get
{
return this.negativeSign;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.negativeSign = value;
}
}
/// <summary>Gets or sets the number of decimal places to use in numeric values.</summary>
/// <returns>The number of decimal places to use in numeric values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 2.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 99. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000382 RID: 898
// (get) Token: 0x0600143E RID: 5182 RVA: 0x0004E7F0 File Offset: 0x0004C9F0
// (set) Token: 0x0600143F RID: 5183 RVA: 0x0004E7F8 File Offset: 0x0004C9F8
public int NumberDecimalDigits
{
get
{
return this.numberDecimalDigits;
}
set
{
if (value < 0 || value > 99)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 99");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.numberDecimalDigits = value;
}
}
/// <summary>Gets or sets the string to use as the decimal separator in numeric values.</summary>
/// <returns>The string to use as the decimal separator in numeric values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is ".".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
/// <exception cref="T:System.ArgumentException">The property is being set to an empty string.</exception>
// Token: 0x17000383 RID: 899
// (get) Token: 0x06001440 RID: 5184 RVA: 0x0004E834 File Offset: 0x0004CA34
// (set) Token: 0x06001441 RID: 5185 RVA: 0x0004E83C File Offset: 0x0004CA3C
public string NumberDecimalSeparator
{
get
{
return this.numberDecimalSeparator;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.numberDecimalSeparator = value;
}
}
/// <summary>Gets or sets the string that separates groups of digits to the left of the decimal in numeric values.</summary>
/// <returns>The string that separates groups of digits to the left of the decimal in numeric values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is ",".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000384 RID: 900
// (get) Token: 0x06001442 RID: 5186 RVA: 0x0004E878 File Offset: 0x0004CA78
// (set) Token: 0x06001443 RID: 5187 RVA: 0x0004E880 File Offset: 0x0004CA80
public string NumberGroupSeparator
{
get
{
return this.numberGroupSeparator;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.numberGroupSeparator = value;
}
}
/// <summary>Gets or sets the number of digits in each group to the left of the decimal in numeric values.</summary>
/// <returns>The number of digits in each group to the left of the decimal in numeric values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is a one-dimensional array with only one element, which is set to 3.</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.ArgumentException">The property is being set and the array contains an entry that is less than 0 or greater than 9.-or- The property is being set and the array contains an entry, other than the last entry, that is set to 0. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000385 RID: 901
// (get) Token: 0x06001444 RID: 5188 RVA: 0x0004E8BC File Offset: 0x0004CABC
// (set) Token: 0x06001445 RID: 5189 RVA: 0x0004E8D0 File Offset: 0x0004CAD0
public int[] NumberGroupSizes
{
get
{
return (int[])this.RawNumberGroupSizes.Clone();
}
set
{
this.RawNumberGroupSizes = value;
}
}
// Token: 0x17000386 RID: 902
// (get) Token: 0x06001446 RID: 5190 RVA: 0x0004E8DC File Offset: 0x0004CADC
// (set) Token: 0x06001447 RID: 5191 RVA: 0x0004E8E4 File Offset: 0x0004CAE4
internal int[] RawNumberGroupSizes
{
get
{
return this.numberGroupSizes;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
if (value.Length == 0)
{
this.numberGroupSizes = new int[0];
return;
}
int num = value.Length - 1;
for (int i = 0; i < num; i++)
{
if (value[i] < 1 || value[i] > 9)
{
throw new ArgumentOutOfRangeException("One of the elements in the array specified is not between 1 and 9");
}
}
if (value[num] < 0 || value[num] > 9)
{
throw new ArgumentOutOfRangeException("Last element in the array specified is not between 0 and 9");
}
this.numberGroupSizes = (int[])value.Clone();
}
}
/// <summary>Gets or sets the format pattern for negative numeric values.</summary>
/// <returns>The format pattern for negative numeric values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 1, which represents "-n", where <paramref name="n" /> is a number.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 4. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000387 RID: 903
// (get) Token: 0x06001448 RID: 5192 RVA: 0x0004E994 File Offset: 0x0004CB94
// (set) Token: 0x06001449 RID: 5193 RVA: 0x0004E99C File Offset: 0x0004CB9C
public int NumberNegativePattern
{
get
{
return this.numberNegativePattern;
}
set
{
if (value < 0 || value > 4)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 15");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.numberNegativePattern = value;
}
}
/// <summary>Gets or sets the number of decimal places to use in percent values. </summary>
/// <returns>The number of decimal places to use in percent values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 2.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 99. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000388 RID: 904
// (get) Token: 0x0600144A RID: 5194 RVA: 0x0004E9E0 File Offset: 0x0004CBE0
// (set) Token: 0x0600144B RID: 5195 RVA: 0x0004E9E8 File Offset: 0x0004CBE8
public int PercentDecimalDigits
{
get
{
return this.percentDecimalDigits;
}
set
{
if (value < 0 || value > 99)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 99");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.percentDecimalDigits = value;
}
}
/// <summary>Gets or sets the string to use as the decimal separator in percent values. </summary>
/// <returns>The string to use as the decimal separator in percent values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is ".".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
/// <exception cref="T:System.ArgumentException">The property is being set to an empty string.</exception>
// Token: 0x17000389 RID: 905
// (get) Token: 0x0600144C RID: 5196 RVA: 0x0004EA24 File Offset: 0x0004CC24
// (set) Token: 0x0600144D RID: 5197 RVA: 0x0004EA2C File Offset: 0x0004CC2C
public string PercentDecimalSeparator
{
get
{
return this.percentDecimalSeparator;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.percentDecimalSeparator = value;
}
}
/// <summary>Gets or sets the string that separates groups of digits to the left of the decimal in percent values. </summary>
/// <returns>The string that separates groups of digits to the left of the decimal in percent values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is ",".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700038A RID: 906
// (get) Token: 0x0600144E RID: 5198 RVA: 0x0004EA68 File Offset: 0x0004CC68
// (set) Token: 0x0600144F RID: 5199 RVA: 0x0004EA70 File Offset: 0x0004CC70
public string PercentGroupSeparator
{
get
{
return this.percentGroupSeparator;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.percentGroupSeparator = value;
}
}
/// <summary>Gets or sets the number of digits in each group to the left of the decimal in percent values. </summary>
/// <returns>The number of digits in each group to the left of the decimal in percent values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is a one-dimensional array with only one element, which is set to 3.</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.ArgumentException">The property is being set and the array contains an entry that is less than 0 or greater than 9.-or- The property is being set and the array contains an entry, other than the last entry, that is set to 0. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700038B RID: 907
// (get) Token: 0x06001450 RID: 5200 RVA: 0x0004EAAC File Offset: 0x0004CCAC
// (set) Token: 0x06001451 RID: 5201 RVA: 0x0004EAC0 File Offset: 0x0004CCC0
public int[] PercentGroupSizes
{
get
{
return (int[])this.RawPercentGroupSizes.Clone();
}
set
{
this.RawPercentGroupSizes = value;
}
}
// Token: 0x1700038C RID: 908
// (get) Token: 0x06001452 RID: 5202 RVA: 0x0004EACC File Offset: 0x0004CCCC
// (set) Token: 0x06001453 RID: 5203 RVA: 0x0004EAD4 File Offset: 0x0004CCD4
internal int[] RawPercentGroupSizes
{
get
{
return this.percentGroupSizes;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
if (this == CultureInfo.CurrentCulture.NumberFormat)
{
throw new Exception("HERE the value was modified");
}
if (value.Length == 0)
{
this.percentGroupSizes = new int[0];
return;
}
int num = value.Length - 1;
for (int i = 0; i < num; i++)
{
if (value[i] < 1 || value[i] > 9)
{
throw new ArgumentOutOfRangeException("One of the elements in the array specified is not between 1 and 9");
}
}
if (value[num] < 0 || value[num] > 9)
{
throw new ArgumentOutOfRangeException("Last element in the array specified is not between 0 and 9");
}
this.percentGroupSizes = (int[])value.Clone();
}
}
/// <summary>Gets or sets the format pattern for negative percent values.</summary>
/// <returns>The format pattern for negative percent values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 0, which represents "-n %", where "%" is the <see cref="P:System.Globalization.NumberFormatInfo.PercentSymbol" /> and <paramref name="n" /> is a number.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 11. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700038D RID: 909
// (get) Token: 0x06001454 RID: 5204 RVA: 0x0004EBA0 File Offset: 0x0004CDA0
// (set) Token: 0x06001455 RID: 5205 RVA: 0x0004EBA8 File Offset: 0x0004CDA8
public int PercentNegativePattern
{
get
{
return this.percentNegativePattern;
}
set
{
if (value < 0 || value > 2)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 15");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.percentNegativePattern = value;
}
}
/// <summary>Gets or sets the format pattern for positive percent values.</summary>
/// <returns>The format pattern for positive percent values. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is 0, which represents "n %", where "%" is the <see cref="P:System.Globalization.NumberFormatInfo.PercentSymbol" /> and <paramref name="n" /> is a number.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The property is being set to a value that is less than 0 or greater than 3. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700038E RID: 910
// (get) Token: 0x06001456 RID: 5206 RVA: 0x0004EBEC File Offset: 0x0004CDEC
// (set) Token: 0x06001457 RID: 5207 RVA: 0x0004EBF4 File Offset: 0x0004CDF4
public int PercentPositivePattern
{
get
{
return this.percentPositivePattern;
}
set
{
if (value < 0 || value > 2)
{
throw new ArgumentOutOfRangeException("The value specified for the property is less than 0 or greater than 3");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.percentPositivePattern = value;
}
}
/// <summary>Gets or sets the string to use as the percent symbol.</summary>
/// <returns>The string to use as the percent symbol. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "%".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x1700038F RID: 911
// (get) Token: 0x06001458 RID: 5208 RVA: 0x0004EC38 File Offset: 0x0004CE38
// (set) Token: 0x06001459 RID: 5209 RVA: 0x0004EC40 File Offset: 0x0004CE40
public string PercentSymbol
{
get
{
return this.percentSymbol;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.percentSymbol = value;
}
}
/// <summary>Gets or sets the string to use as the per mille symbol.</summary>
/// <returns>The string to use as the per mille symbol. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "‰", which is the Unicode character U+2030.</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000390 RID: 912
// (get) Token: 0x0600145A RID: 5210 RVA: 0x0004EC7C File Offset: 0x0004CE7C
// (set) Token: 0x0600145B RID: 5211 RVA: 0x0004EC84 File Offset: 0x0004CE84
public string PerMilleSymbol
{
get
{
return this.perMilleSymbol;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.perMilleSymbol = value;
}
}
/// <summary>Gets or sets the string that represents positive infinity.</summary>
/// <returns>The string that represents positive infinity. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "Infinity".</returns>
/// <exception cref="T:System.ArgumentNullException">The property is being set to null. </exception>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000391 RID: 913
// (get) Token: 0x0600145C RID: 5212 RVA: 0x0004ECC0 File Offset: 0x0004CEC0
// (set) Token: 0x0600145D RID: 5213 RVA: 0x0004ECC8 File Offset: 0x0004CEC8
public string PositiveInfinitySymbol
{
get
{
return this.positiveInfinitySymbol;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.positiveInfinitySymbol = value;
}
}
/// <summary>Gets or sets the string that denotes that the associated number is positive.</summary>
/// <returns>The string that denotes that the associated number is positive. The default for <see cref="P:System.Globalization.NumberFormatInfo.InvariantInfo" /> is "+".</returns>
/// <exception cref="T:System.InvalidOperationException">The property is being set and the <see cref="T:System.Globalization.NumberFormatInfo" /> is read-only. </exception>
// Token: 0x17000392 RID: 914
// (get) Token: 0x0600145E RID: 5214 RVA: 0x0004ED04 File Offset: 0x0004CF04
// (set) Token: 0x0600145F RID: 5215 RVA: 0x0004ED0C File Offset: 0x0004CF0C
public string PositiveSign
{
get
{
return this.positiveSign;
}
set
{
if (value == null)
{
throw new ArgumentNullException("The value specified for the property is a null reference");
}
if (this.isReadOnly)
{
throw new InvalidOperationException("The current instance is read-only and a set operation was attempted");
}
this.positiveSign = value;
}
}
/// <summary>Gets an object of the specified type that provides a number formatting service.</summary>
/// <returns>The current <see cref="T:System.Globalization.NumberFormatInfo" />, if <paramref name="formatType" /> is the same as the type of the current <see cref="T:System.Globalization.NumberFormatInfo" />; otherwise, null.</returns>
/// <param name="formatType">The <see cref="T:System.Type" /> of the required formatting service. </param>
// Token: 0x06001460 RID: 5216 RVA: 0x0004ED48 File Offset: 0x0004CF48
public object GetFormat(Type formatType)
{
return (formatType != typeof(NumberFormatInfo)) ? null : this;
}
/// <summary>Creates a shallow copy of the <see cref="T:System.Globalization.NumberFormatInfo" />.</summary>
/// <returns>A new <see cref="T:System.Globalization.NumberFormatInfo" /> copied from the original <see cref="T:System.Globalization.NumberFormatInfo" />.</returns>
// Token: 0x06001461 RID: 5217 RVA: 0x0004ED64 File Offset: 0x0004CF64
public object Clone()
{
NumberFormatInfo numberFormatInfo = (NumberFormatInfo)base.MemberwiseClone();
numberFormatInfo.isReadOnly = false;
return numberFormatInfo;
}
/// <summary>Returns a read-only <see cref="T:System.Globalization.NumberFormatInfo" /> wrapper.</summary>
/// <returns>A read-only <see cref="T:System.Globalization.NumberFormatInfo" /> wrapper around <paramref name="nfi" />.</returns>
/// <param name="nfi">The <see cref="T:System.Globalization.NumberFormatInfo" /> to wrap. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="nfi" /> is null. </exception>
// Token: 0x06001462 RID: 5218 RVA: 0x0004ED88 File Offset: 0x0004CF88
public static NumberFormatInfo ReadOnly(NumberFormatInfo nfi)
{
NumberFormatInfo numberFormatInfo = (NumberFormatInfo)nfi.Clone();
numberFormatInfo.isReadOnly = true;
return numberFormatInfo;
}
/// <summary>Gets the <see cref="T:System.Globalization.NumberFormatInfo" /> associated with the specified <see cref="T:System.IFormatProvider" />.</summary>
/// <returns>The <see cref="T:System.Globalization.NumberFormatInfo" /> associated with the specified <see cref="T:System.IFormatProvider" />.</returns>
/// <param name="formatProvider">The <see cref="T:System.IFormatProvider" /> used to get the <see cref="T:System.Globalization.NumberFormatInfo" />.-or- null to get <see cref="P:System.Globalization.NumberFormatInfo.CurrentInfo" />. </param>
// Token: 0x06001463 RID: 5219 RVA: 0x0004EDAC File Offset: 0x0004CFAC
public static NumberFormatInfo GetInstance(IFormatProvider formatProvider)
{
if (formatProvider != null)
{
NumberFormatInfo numberFormatInfo = (NumberFormatInfo)formatProvider.GetFormat(typeof(NumberFormatInfo));
if (numberFormatInfo != null)
{
return numberFormatInfo;
}
}
return NumberFormatInfo.CurrentInfo;
}
// Token: 0x0400058E RID: 1422
private bool isReadOnly;
// Token: 0x0400058F RID: 1423
private string decimalFormats;
// Token: 0x04000590 RID: 1424
private string currencyFormats;
// Token: 0x04000591 RID: 1425
private string percentFormats;
// Token: 0x04000592 RID: 1426
private string digitPattern = "#";
// Token: 0x04000593 RID: 1427
private string zeroPattern = "0";
// Token: 0x04000594 RID: 1428
private int currencyDecimalDigits;
// Token: 0x04000595 RID: 1429
private string currencyDecimalSeparator;
// Token: 0x04000596 RID: 1430
private string currencyGroupSeparator;
// Token: 0x04000597 RID: 1431
private int[] currencyGroupSizes;
// Token: 0x04000598 RID: 1432
private int currencyNegativePattern;
// Token: 0x04000599 RID: 1433
private int currencyPositivePattern;
// Token: 0x0400059A RID: 1434
private string currencySymbol;
// Token: 0x0400059B RID: 1435
private string nanSymbol;
// Token: 0x0400059C RID: 1436
private string negativeInfinitySymbol;
// Token: 0x0400059D RID: 1437
private string negativeSign;
// Token: 0x0400059E RID: 1438
private int numberDecimalDigits;
// Token: 0x0400059F RID: 1439
private string numberDecimalSeparator;
// Token: 0x040005A0 RID: 1440
private string numberGroupSeparator;
// Token: 0x040005A1 RID: 1441
private int[] numberGroupSizes;
// Token: 0x040005A2 RID: 1442
private int numberNegativePattern;
// Token: 0x040005A3 RID: 1443
private int percentDecimalDigits;
// Token: 0x040005A4 RID: 1444
private string percentDecimalSeparator;
// Token: 0x040005A5 RID: 1445
private string percentGroupSeparator;
// Token: 0x040005A6 RID: 1446
private int[] percentGroupSizes;
// Token: 0x040005A7 RID: 1447
private int percentNegativePattern;
// Token: 0x040005A8 RID: 1448
private int percentPositivePattern;
// Token: 0x040005A9 RID: 1449
private string percentSymbol;
// Token: 0x040005AA RID: 1450
private string perMilleSymbol;
// Token: 0x040005AB RID: 1451
private string positiveInfinitySymbol;
// Token: 0x040005AC RID: 1452
private string positiveSign;
// Token: 0x040005AD RID: 1453
private string ansiCurrencySymbol;
// Token: 0x040005AE RID: 1454
private int m_dataItem;
// Token: 0x040005AF RID: 1455
private bool m_useUserOverride;
// Token: 0x040005B0 RID: 1456
private bool validForParseAsNumber;
// Token: 0x040005B1 RID: 1457
private bool validForParseAsCurrency;
// Token: 0x040005B2 RID: 1458
private string[] nativeDigits = NumberFormatInfo.invariantNativeDigits;
// Token: 0x040005B3 RID: 1459
private int digitSubstitution = 1;
// Token: 0x040005B4 RID: 1460
private static readonly string[] invariantNativeDigits = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
}
}