   1| ' Licensed to the .NET Foundation under one or more agreements.
   2| ' The .NET Foundation licenses this file to you under the MIT license.
   4| Imports System
   5| Imports System.Diagnostics.CodeAnalysis
   6| Imports System.Globalization
   7| Imports System.Runtime.Versioning
   8| Imports System.Text
   9| Imports Microsoft.VisualBasic.CompilerServices
  10| Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils
  11| Imports Microsoft.VisualBasic.CompilerServices.Utils
  13| Namespace Global.Microsoft.VisualBasic
  15|     Friend NotInheritable Class FormatInfoHolder
  16|         Implements IFormatProvider
  18|         Friend Sub New(ByVal nfi As NumberFormatInfo)
  19|             MyBase.New()
  20|             Me.nfi = nfi
  21|         End Sub
  23|         Private nfi As NumberFormatInfo
  25|         Private Function GetFormat(ByVal service As Type) As Object Implements IFormatProvider.GetFormat
  26|             If service Is GetType(NumberFormatInfo) Then
  27|                 Return nfi
  28|             End If
  29|             Throw New ArgumentException(SR.InternalError_VisualBasicRuntime)
  30|         End Function
  32|     End Class
  34|     Public Module Strings
  35|         'Positive format strings
  36|         '0      $n
  37|         '1      n$
  38|         '2      $ n
  39|         '3      n $
  40|         Private ReadOnly CurrencyPositiveFormatStrings() As String = {"'$'n", "n'$'", "'$' n", "n '$'"} 'Note, we wrap the $ in the literal symbol to avoid misinterpretation when using the escape character \ as a currency mark
  42|         'The negative currency pattern needs to be selected based
  43|         '  on the criteria provided for parens
  44|         'nfi.CurrencyPositivePattern
  45|

... [truncated 99199 chars] ...

  sDest = New String(" "c, length)
2227|                 lenDest = UnsafeNativeMethods.LCMapString(lcid, dwMapFlags, sSrc, length, sDest, length)
2228|                 Return sDest
2229|             End If
2231|         End Function
2232| #End If
2234|         Private Sub ValidateTriState(ByVal Param As TriState)
2235|             If (Param <> vbTrue) AndAlso (Param <> vbFalse) AndAlso (Param <> vbUseDefault) Then
2236|                 Throw VbMakeException(vbErrors.IllegalFuncCall)
2237|             End If
2238|         End Sub
2240|         Private Function IsArrayEmpty(ByVal array As System.Array) As Boolean
2241|             If array Is Nothing Then
2242|                 Return True
2243|             End If
2244|             Return (array.Length = 0)
2245|         End Function
2246|     End Module
2247| End Namespace