Imports System.Xml.Serialization
'''
''' Represents a way of describing an element.
'''
Public Structure BBCodeElementTypeDefinition
Private __TagName As String
Private __RequireClosingTag As Boolean
Private __Type As Type
'''
''' Gets the name of the element.
'''
_
Public Property TagName() As String
Get
Return __TagName
End Get
Set(ByVal value As String)
__TagName = value.ToUpperInvariant()
End Set
End Property
_
Public Property Type() As Type
Get
Return __Type
End Get
Set(ByVal value As Type)
__Type = value
End Set
End Property
'''
''' Gets or sets a value indicating if the element requires a closing tag.
'''
_
Public Property RequireClosingTag() As Boolean
Get
Return __RequireClosingTag
End Get
Set(ByVal value As Boolean)
__RequireClosingTag = value
End Set
End Property
''' Indicates whether this instance and a specified object are equal.
''' true if and this instance are the same type and represent the same value; otherwise, false.
''' Another object to compare to.
''' 2
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If Not (TypeOf obj Is BBCodeElementTypeDefinition) Then
Return False
End If
Return (Me.TagName = obj.TagName AndAlso Me.Type.Equals(DirectCast(obj, BBCodeElementTypeDefinition).Type) AndAlso Me.RequireClosingTag = obj.RequireClosingTag)
End Function
''' Returns the hash code for this instance.
''' A 32-bit signed integer that is the hash code for this instance.
''' 2
Public Overrides Function GetHashCode() As Integer
Dim hash As Long = Me.TagName.GetHashCode() + Me.Type.GetHashCode() + Me.RequireClosingTag.GetHashCode()
Return hash And Integer.MinValue
End Function
Public Shared Operator =(ByVal left As BBCodeElementTypeDefinition, ByVal right As BBCodeElementTypeDefinition) As Boolean
Return left.Equals(right)
End Operator
Public Shared Operator <>(ByVal left As BBCodeElementTypeDefinition, ByVal right As BBCodeElementTypeDefinition) As Boolean
Return Not left = right
End Operator
End Structure