1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 //
6 
7 //
8 
9 using System;
10 using System.Globalization;
11 using System.Runtime.InteropServices;
12 
13 #if !FEATURE_SLJ_PROJECTION_COMPAT
14 #pragma warning disable 436   // Redefining types from Windows.Foundation
15 #endif // !FEATURE_SLJ_PROJECTION_COMPAT
16 
17 #if FEATURE_SLJ_PROJECTION_COMPAT
18 namespace System.Windows
19 #else // !FEATURE_SLJ_PROJECTION_COMPAT
20 
21 
22 namespace Windows.Foundation
23 #endif // FEATURE_SLJ_PROJECTION_COMPAT
24 {
25     //
26     // Note that this type is owned by the Jupiter team.  Please contact them before making any
27     // changes here.
28     //
29 
30     internal static class TokenizerHelper
31     {
GetNumericListSeparator(IFormatProvider provider)32         internal static char GetNumericListSeparator(IFormatProvider provider)
33         {
34             char numericSeparator = ',';
35 
36             // Get the NumberFormatInfo out of the provider, if possible
37             // If the IFormatProvider doesn't not contain a NumberFormatInfo, then
38             // this method returns the current culture's NumberFormatInfo.
39             NumberFormatInfo numberFormat = NumberFormatInfo.GetInstance(provider);
40 
41             // Is the decimal separator is the same as the list separator?
42             // If so, we use the ";".
43             if ((numberFormat.NumberDecimalSeparator.Length > 0) && (numericSeparator == numberFormat.NumberDecimalSeparator[0]))
44             {
45                 numericSeparator = ';';
46             }
47 
48             return numericSeparator;
49         }
50     }
51 }
52 
53 #if !FEATURE_SLJ_PROJECTION_COMPAT
54 #pragma warning restore 436
55 #endif // !FEATURE_SLJ_PROJECTION_COMPAT
56 
57