Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AddProvider()

static void System.Text.EncodingProvider.AddProvider ( EncodingProvider provider)
inlinestaticpackage

Definition at line 47 of file EncodingProvider.cs.

48 {
49 if (provider == null)
50 {
51 throw new ArgumentNullException("provider");
52 }
53 if (s_providers == null && Interlocked.CompareExchange(ref s_providers, new EncodingProvider[1] { provider }, null) == null)
54 {
55 return;
56 }
59 do
60 {
62 if (Array.IndexOf(array, provider) >= 0)
63 {
64 break;
65 }
66 array2 = new EncodingProvider[array.Length + 1];
67 Array.Copy(array, array2, array.Length);
68 array2[^1] = provider;
69 }
71 }
static volatile EncodingProvider[] s_providers
static int CompareExchange(ref int location1, int value, int comparand)

References System.array, System.Threading.Interlocked.CompareExchange(), System.Array.Copy(), System.Array.IndexOf(), and System.Text.EncodingProvider.s_providers.

Referenced by System.Text.Encoding.RegisterProvider().