Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' ***********************************************************************
- ' Author : Elektro
- ' Modified : 17-December-2015
- ' ***********************************************************************
- #Region " Imports "
- Imports System
- Imports System.ComponentModel
- Imports System.Diagnostics
- Imports System.Linq
- #End Region
- #Region " INI Section "
- Namespace Types
- ''' ----------------------------------------------------------------------------------------------------
- ''' <summary>
- ''' Represents a initialization file (INI) section.
- ''' </summary>
- ''' ----------------------------------------------------------------------------------------------------
- Public NotInheritable Class IniSection
- #Region " Properties "
- ''' ----------------------------------------------------------------------------------------------------
- ''' <summary>
- ''' Gets or sets the section name.
- ''' </summary>
- ''' ----------------------------------------------------------------------------------------------------
- ''' <value>
- ''' The section name.
- ''' </value>
- ''' ----------------------------------------------------------------------------------------------------
- Public Property Name As String
- ''' ----------------------------------------------------------------------------------------------------
- ''' <summary>
- ''' Gets or sets the section keys.
- ''' </summary>
- ''' ----------------------------------------------------------------------------------------------------
- ''' <value>
- ''' The section keys.
- ''' </value>
- ''' ----------------------------------------------------------------------------------------------------
- Public Property Keys As IniKeyCollection
- #End Region
- #Region " Constructors "
- ''' ----------------------------------------------------------------------------------------------------
- ''' <summary>
- ''' Prevents a default instance of the <see cref="IniSection"/> class from being created.
- ''' </summary>
- ''' ----------------------------------------------------------------------------------------------------
- <DebuggerNonUserCode>
- Private Sub New()
- End Sub
- ''' ----------------------------------------------------------------------------------------------------
- ''' <summary>
- ''' Initializes a new instance of the <see cref="IniSection"/> class.
- ''' </summary>
- ''' ----------------------------------------------------------------------------------------------------
- ''' <param name="name">
- ''' The section name.
- ''' </param>
- ''' ----------------------------------------------------------------------------------------------------
- <DebuggerStepThrough>
- Public Sub New(ByVal name As String)
- Me.New(name, New IniKeyCollection)
- End Sub
- ''' ----------------------------------------------------------------------------------------------------
- ''' <summary>
- ''' Initializes a new instance of the <see cref="IniSection"/> class.
- ''' </summary>
- ''' ----------------------------------------------------------------------------------------------------
- ''' <param name="name">
- ''' The section name.
- ''' </param>
- '''
- ''' <param name="keys">
- ''' The section keys.
- ''' </param>
- ''' ----------------------------------------------------------------------------------------------------
- ''' <exception cref="System.ArgumentNullException">
- ''' name
- ''' </exception>
- '''
- ''' <exception cref="System.ArgumentException">
- ''' The section name cannot contain the '[' or ']' symbols because it identifies a section.,name
- ''' </exception>
- ''' ----------------------------------------------------------------------------------------------------
- <DebuggerStepThrough>
- Public Sub New(ByVal name As String, ByVal keys As IniKeyCollection)
- If (String.IsNullOrEmpty(name)) Then
- Throw New ArgumentNullException(paramName:="name")
- ElseIf (name.Contains("["c)) OrElse (name.Contains("]"c)) Then
- Throw New ArgumentException(
- message:="The section name cannot contain the '[' or ']' symbols because it identifies a section.",
- paramName:="name")
- Else
- Me.Name = name
- Me.Keys = keys
- End If
- End Sub
- #End Region
- End Class
- End Namespace
- #End Region
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement