⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constructors.cls

📁 VB 加密----------能够加密解密控件
💻 CLS
📖 第 1 页 / 共 5 页
字号:
Public Function NewArrayList(Optional ByVal Comparer As IComparer, Optional ByRef c As Variant) As ArrayList
    Set NewArrayList = New ArrayList
    Call NewArrayList.Init(Comparer, c)
End Function

''
' Creates a new SerializationException object.
'
' @param Message A human-readable message explaining the exception.
' @param InnerException An exception that caused this exception.
' @return A fully created SerializationException object.
'
Public Function NewSerializationException(ByVal Message As String, Optional ByVal InnerException As Exception) As SerializationException
    Set NewSerializationException = New SerializationException
    Call NewSerializationException.Init(Message, InnerException)
End Function

''
' Creates a new Stack object initialized with data in <i>col</i>.
'
' @param col A collection of items to initalize the Stack object with.
' @return A new Stack object containing the collection of values.
' @remarks <i>col</i> can be a VBA.Collection, an object implementing ICollection, or an Array.
'
Public Function NewStack(ByRef Col As Variant) As Stack
    Set NewStack = New Stack
    Call NewStack.Init(Col)
End Function

''
' Creates a new ArrayTypeMismatchException object.
'
' @param Message A human-readable message explaining the exception.
' @param InnerException An exception that caused this exception.
' @return A fully created ArrayTypeMismatchException object.
'
Public Function NewArrayTypeMismatchException(ByVal Message As String, Optional ByVal InnerException As Exception) As ArrayTypeMismatchException
    Set NewArrayTypeMismatchException = New ArrayTypeMismatchException
    Call NewArrayTypeMismatchException.Init(Message, InnerException)
End Function

''
' Creates a new DictionaryEntry object initialized with <i>key</i> and <i>value</i>.
'
' @param Key A value designated as the key of the pair.
' @param value A value designated as the value of the pair.
' @return A new DictionaryEntry containing a key/value pair.
'
Public Function NewDictionaryEntry(ByRef Key As Variant, ByRef Value As Variant) As DictionaryEntry
    Set NewDictionaryEntry = New DictionaryEntry
    Call NewDictionaryEntry.Init(Key, Value)
End Function

''
' Creates a new SortedList object with specific initialization options.
'
' @param list An object implementing IDictionary used to initialize the list from.
' @param comparer An object implementing IComparer used to search and sort keys in the list.
' @param capacity An initial list size.
' @return A new SortedList object with the specific initializations.
'
Public Function NewSortedList(Optional ByVal List As IDictionary, Optional ByVal Comparer As IComparer, Optional ByVal Capacity As Long = 16) As SortedList
    Set NewSortedList = New SortedList
    Call NewSortedList.Init(List, Comparer, Capacity)
End Function

''
' Creates a new BitArray object.
'
' @param Length The number of bits the object will represent.
' @param value The value to initialize all the bits to (True = 1, False = 0).
' @return A new BitArray object set to the specified length with the specified value.
'
Public Function NewBitArray(ByVal Length As Long, Optional ByVal Value As Boolean = False) As BitArray
    Set NewBitArray = New BitArray
    Call NewBitArray.Init(Length, Value)
End Function

''
' Creates a new WeakReference object.
'
' @param Target The object to maintain a weak reference to.
' @return A new WeakReference object.
'
Public Function NewWeakReference(ByVal Target As Object) As WeakReference
    Set NewWeakReference = New WeakReference
    Call NewWeakReference.Init(Target)
End Function

''
' Creates a new FormatException object.
'
' @param Message A human-readable message explaining the exception.
' @param InnerException An exception that caused this exception.
' @return A fully created FormatException object.
'
Public Function NewFormatException(ByVal Message As String, Optional ByVal InnerException As Exception) As FormatException
    Set NewFormatException = New FormatException
    Call NewFormatException.Init(Message, InnerException)
End Function

''
' Creates a new Random object initialized with the specified seed.
'
' @param seed The value used to initialize the random number generator with.
' @return A new Random object.
'
Public Function NewRandom(ByVal seed As Long) As Random
    Set NewRandom = New Random
    Call NewRandom.Init(seed)
End Function

''
' Creates a new Version object with specified version information.
'
' @param Major The number to describe an application level change.
' @param Minor The number that describes a component level change.
' @param Build The number used to describe an integration compiling of the application.
' @param Revision Minor adjustments to the application.
' @return A new Version object.
'
Public Function NewVersion(ByVal Major As Long, ByVal Minor As Long, Optional ByRef Build As Variant, Optional ByRef Revision As Variant) As Version
    Set NewVersion = New Version
    Call NewVersion.Init(Major, Minor, Build, Revision)
End Function

''
' Creates a new TimeSpan object set to the specified amount of time.
'
' @param Days The number of days in the timespan.
' @param Hours The number of hours in the timespan.
' @param Minutes The number of minutes in the timespan.
' @param Seconds The number of seconds in the timespan.
' @param Milliseconds The number of milliseconds in the timespan.
' @return A TimeSpan with the specified time.
' @remarks The values can be both positive and negative.
'
Public Function NewTimeSpan(Optional ByVal Days As Long, Optional ByVal Hours As Long, Optional ByVal Minutes As Long, Optional ByVal Seconds As Long, Optional ByVal Milliseconds As Long) As TimeSpan
    Set NewTimeSpan = New TimeSpan
    Call NewTimeSpan.Init(Days, Hours, Minutes, Seconds, Milliseconds)
End Function

''
' Creates a new cDateTime object set to the specified date.
'
' @param Year The year of the date.
' @param Month The month of the date.
' @param Day The day of the date.
' @param Hour The hour of the time portion of the date.
' @param Minute The minute of the time portion of the date.
' @param Second The second of the time portion of the date.
' @param Millisecond The millisecond of the time portion of the date.
' @param Calendar The calendar to use to create a cDateTime for a specific culture.
' @param Kind Specifies whether the cDateTime is a UTC, Local, or unspecified time type.
' @return A new cDateTime object initialized to the specified date and time.
'
Public Function NewcDateTime(Optional ByVal Year As Long, Optional ByVal Month As Long, Optional ByVal Day As Long, Optional ByVal Hour As Long, Optional ByVal Minute As Long, Optional ByVal Second As Long, Optional ByVal Millisecond As Long, Optional ByVal Calendar As Calendar, Optional ByVal Kind As DateTimeKind = UnspecifiedKind) As cDateTime
    Set NewcDateTime = New cDateTime
    Call NewcDateTime.Init(Year, Month, Day, Hour, Minute, Second, Millisecond, Calendar, Kind)
End Function

''
' Creates a new IOException object with the specified Message, HResult, and InnerException.
'
' @param Message A human-readable error message.
' @param HResult The underlying error code.
' @param InnerException The exception that caused this exception.
' @return A new IOException object.
'
Public Function NewIOException(ByVal Message As String, Optional ByVal HResult As Long = COR_E_IO, Optional ByVal InnerException As Exception) As IOException
    Set NewIOException = New IOException
    Call NewIOException.Init(Message, HResult, InnerException)
End Function

''
' Creates a new FileNotFoundException with the specified Message, FileName, and InnerException.
'
' @param Message A human-readable error message.
' @param FileName The filename that caused the exception.
' @param InnerException The exception that caused this exception.
' @return A new FileNotFoundException with the specified values.
'
Public Function NewFileNotFoundException(Optional ByVal FileName As String, Optional ByVal Message As String, Optional ByVal InnerException As Exception) As FileNotFoundException
    Set NewFileNotFoundException = New FileNotFoundException
    Call NewFileNotFoundException.Init(FileName, Message, InnerException)
End Function

''
' Creates a memory-mapped view of a file.
'
' @param Path The file to be mapped to memory.
' @param Access The access to this mapping of the file.
' @param Share How should the file be shared with other processes.
' @return The new mapped view object.
'
Public Function NewMemoryMappedFile(ByVal Path As String, Optional ByVal Access As FileAccess = FileAccess.ReadAccess, Optional ByVal Share As FileShare = FileShare.ReadShare) As MemoryMappedFile
    Set NewMemoryMappedFile = New MemoryMappedFile
    Call NewMemoryMappedFile.Init(Path, Access, Share)
End Function

''
' Creates a new CultureInfo object for the specified culture.
'
' @param NameOrLCID The name or Locale ID of the culture to be created.
' @param UseUserOverride A flag indicating if the local machine settings should
' be used instead of the stored setting. This only applies to the culture of
' the current machine.
' @return The newly created CultureInfo object.
'
Public Function NewCultureInfo(ByRef NameOrLCID As Variant, Optional ByVal UseUserOverride As Boolean = True) As CultureInfo
    Set NewCultureInfo = New CultureInfo
    Call NewCultureInfo.Init(NameOrLCID, UseUserOverride)
End Function

''
' Creates a new DayLightTime object with the specified start and end times for daylight savings.
'
' @param StartTime The starting of the daylight savings period.
' @param EndTime The ending of the daylight savings period.
' @param Delta The time difference between daylight savings time and standard time.
' @return A newly created DayLightTime object.
'
Public Function NewDayLightTime(ByRef StartTime As Variant, ByRef EndTime As Variant, ByVal Delta As TimeSpan) As DayLightTime
    Set NewDayLightTime = New DayLightTime
    Call NewDayLightTime.Init(StartTime, EndTime, Delta)
End Function

''
' Returns a new OperatingSystem object with the specified Platform and Version.
'
' @param Platform The platform the OS is.
' @param Version The version of the specified platform.
' @param ServicePack A message describing a service pack.
' @return The new OperatingSystem object.
'
Public Function NewOperatingSystem(ByVal Platform As PlatformID, ByVal Version As Version, Optional ByVal ServicePack As String) As OperatingSystem
    Set NewOperatingSystem = New OperatingSystem
    Call NewOperatingSystem.Init(Platform, Version, ServicePack)
End Function

''
' Returns a new PlatformNotSupportedException with the specified Message and InnerException.
'
' @param Message A human-readable error message.
' @param InnerException The exception that caused this exception.
' @return The new PlatformNotSupportedException object.
'
Public Function NewPlatformNotSupportedException(ByVal Message As String, Optional ByVal InnerException As Exception) As PlatformNotSupportedException
    Set NewPlatformNotSupportedException = New PlatformNotSupportedException
    Call NewPlatformNotSupportedException.Init(Message, InnerException)
End Function

''
' Returns a new PathTooLongException object.
'
' @param Message A human-readable message.
' @param InnerException The exception that caused this exception.
' @return The new PathTooLongException.
'
Public Function NewPathTooLongException(ByVal Message As String, Optional ByVal InnerException As Exception) As PathTooLongException
    Set NewPathTooLongException = New PathTooLongException
    Call NewPathTooLongException.Init(Message, InnerException)
End Function

''
' Returns a new UTF8Encoding object.
'
' @param ShouldEmitUTF8Identifier Indicates whether or not the encoding should emit the preamble bytes in the GetPreamble method.
' @param ShouldThrowException Signals whether or not the encoding should throw an
' exception if the the source bytes are invalid for creating a character array.
' @param The new UTF8Encoding object.
'
Public Function NewUTF8Encoding(ByVal ShouldEmitUTF8Identifier As Boolean, Optional ByVal ShouldThrowException As Boolean) As UTF8Encoding
    Set NewUTF8Encoding = New UTF8Encoding
    Call NewUTF8Encoding.Init(ShouldEmitUTF8Identifier, ShouldThrowException)
End Function

''
' Returns a new UTF7Encoding object.
'
' @param AllowOptionals Signals whether or not to allow the optional character set of O from
' RFC2152 to be directly encoded or not.
' @return The new UTF7Encoding object.
'
Public Function NewUTF7Encoding(ByVal AllowOptionals As Boolean) As UTF7Encoding
    Set NewUTF7Encoding = New UTF7Encoding
    Call NewUTF7Encoding.Init(AllowOptionals)
End Function

''
' Returns a new ObjectDisposedException
'
' @param ObjectName The name of the object that has been disposed of.
' @param Message A human-readable message.
' @return The newly created ObjectDisposedException object.
'
Public Function NewObjectDisposedException(ByVal ObjectName As String, Optional ByVal Message As String) As ObjectDisposedException
    Set NewObjectDisposedException = New ObjectDisposedException
    NewObjectDisposedException.Init ObjectName, Message
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -