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

📄 typedescriptor.vb

📁 大名鼎鼎的mono是.NET平台的跨平台(支持linux
💻 VB
📖 第 1 页 / 共 3 页
字号:
        Get            Dim result As Reflection.Module            result = m_Parent.Compiler.ModuleBuilder            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property [Namespace]() As String        Get            Dim result As String            Helper.Assert(m_Declaration IsNot Nothing)            result = m_Declaration.Namespace            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property UnderlyingSystemType() As System.Type        Get            Dim result As Type            Helper.Assert(m_Declaration IsNot Nothing)            If m_Declaration.TypeBuilder Is Nothing Then                result = Me            Else                result = m_Declaration.TypeBuilder.UnderlyingSystemType            End If            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides Function Equals(ByVal o As Object) As Boolean        Dim result As Boolean        If o Is Me Then            result = True        Else            result = MyBase.Equals(o)        End If        DumpMethodInfo(result)        Return result    End Function    Public Overloads Function Equals(ByVal o As Type) As Boolean        Dim result As Boolean        Dim tmp As TypeDescriptor = Me        Dim MeName As String        Dim oName As String        If TypeOf Me Is TypeParameterDescriptor Then            MeName = Me.Name        Else            MeName = Me.FullName            If MeName Is Nothing Then MeName = Me.Name        End If        If TypeOf o Is TypeParameterDescriptor Then            oName = o.Name        Else            oName = o.FullName            If oName Is Nothing Then oName = o.Name        End If        If o Is Me Then            result = True        ElseIf TypeOf o Is TypeDescriptor Then            If o.IsByRef AndAlso Me.IsByRef Then Return Helper.CompareType(Me.GetElementType, o.GetElementType)            If o.IsArray AndAlso Me.IsArray Then Return Helper.CompareType(Me.GetElementType, o.GetElementType)            If o.IsGenericType AndAlso Me.IsGenericType AndAlso o.IsGenericTypeDefinition = False AndAlso Me.IsGenericTypeDefinition = False AndAlso o.IsGenericParameter = False AndAlso Me.IsGenericParameter = False Then                Dim oTypes As Type() = o.GetGenericArguments                Dim meTypes As Type() = Me.GetGenericArguments()                If Helper.CompareType(o.GetGenericTypeDefinition, Me.GetGenericTypeDefinition) = False Then                    Helper.Assert(NameResolution.CompareName(oName, MeName) = False)                    Return False                End If                If oTypes.Length <> meTypes.Length Then                    Helper.Assert(NameResolution.CompareName(oName, MeName) = False)                    Return False                End If                For i As Integer = 0 To oTypes.Length - 1                    If Helper.CompareType(oTypes(i), meTypes(i)) = False Then                        Helper.Assert(NameResolution.CompareName(oName, MeName) = False)                        Return False                    End If                Next                Helper.Assert(NameResolution.CompareName(oName, MeName))                Return True            End If            result = NameResolution.CompareName(oName, MeName)#If DEBUG Then            If result Then                Compiler.Report.WriteLine(Report.ReportLevels.Debug, "Found two equal types by name: " & oName)            End If#End If        ElseIf m_Declaration IsNot Nothing Then            If m_Declaration.TypeBuilder IsNot Nothing Then                result = Helper.CompareType(m_Declaration.TypeBuilder, o)            Else                result = False            End If        Else            Helper.NotImplemented()        End If        DumpMethodInfo(result)        Return result    End Function    Public Overrides ReadOnly Property ContainsGenericParameters() As Boolean        Get            Dim result As Boolean            Dim genType As GenericTypeDeclaration = TryCast(m_Declaration, GenericTypeDeclaration)            If genType IsNot Nothing Then                If genType.TypeParameters IsNot Nothing Then                    result = genType.TypeParameters.Parameters.Count > 0                End If            End If            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property DeclaringMethod() As System.Reflection.MethodBase        Get            Dim result As MethodBase            Helper.NotImplemented()            result = Nothing            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides Function FindInterfaces(ByVal filter As System.Reflection.TypeFilter, ByVal filterCriteria As Object) As System.Type()        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.FindInterfaces(filter, filterCriteria)    End Function    Public Overrides Function FindMembers(ByVal memberType As System.Reflection.MemberTypes, ByVal bindingAttr As System.Reflection.BindingFlags, ByVal filter As System.Reflection.MemberFilter, ByVal filterCriteria As Object) As System.Reflection.MemberInfo()        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.FindMembers(memberType, bindingAttr, filter, filterCriteria)    End Function    Public Overrides Function GetArrayRank() As Integer        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.GetArrayRank()    End Function    Public Overrides Function GetDefaultMembers() As System.Reflection.MemberInfo()        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.GetDefaultMembers()    End Function    Public Overrides Function GetEvents() As System.Reflection.EventInfo()        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.GetEvents()    End Function    Public Overrides Function GetGenericArguments() As System.Type()        Dim result As Type() = Type.EmptyTypes        Dim tmpResult As New Generic.List(Of Type)        If m_Declaration IsNot Nothing Then            Dim gtd As GenericTypeDeclaration = TryCast(m_Declaration, GenericTypeDeclaration)            If gtd IsNot Nothing Then                If gtd.TypeParameters IsNot Nothing Then                    tmpResult.AddRange(gtd.TypeParameters.Parameters.AsTypeArray)                End If            End If            If Me.IsNested Then                tmpResult.AddRange(Me.DeclaringType.GetGenericArguments)            End If        Else            Helper.NotImplemented()        End If        result = tmpResult.ToArray        DumpMethodInfo(result)        Return result    End Function    Public Overrides Function GetGenericParameterConstraints() As System.Type()        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.GetGenericParameterConstraints()    End Function    Public Overrides Function GetGenericTypeDefinition() As System.Type        Dim result As Type = Nothing        If m_Declaration IsNot Nothing Then            If m_Declaration.TypeBuilder IsNot Nothing Then                result = m_Declaration.TypeBuilder.GetGenericTypeDefinition            ElseIf DirectCast(m_Declaration, GenericTypeDeclaration).TypeParameters Is Nothing Then            Else                Dim tmpGen As GenericTypeDeclaration = TryCast(m_Declaration, GenericTypeDeclaration)                If tmpGen IsNot Nothing AndAlso (tmpGen.TypeParameters Is Nothing OrElse tmpGen.TypeParameters.Parameters.Length = 0) Then                    Return Me                Else                    Helper.NotImplemented()                End If            End If        Else            Helper.NotImplemented()        End If        DumpMethodInfo(result)        Return result    End Function    Public Overrides Function GetHashCode() As Integer        Dim result As Integer        result = m_ObjectID ' MyBase.GetHashCode()        DumpMethodInfo()        Return result    End Function    Public Overrides Function GetInterfaceMap(ByVal interfaceType As System.Type) As System.Reflection.InterfaceMapping        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.GetInterfaceMap(interfaceType)    End Function    Public Overrides Function GetMember(ByVal name As String, ByVal bindingAttr As System.Reflection.BindingFlags) As System.Reflection.MemberInfo()        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.GetMember(name, bindingAttr)    End Function    Public Overrides Function GetMember(ByVal name As String, ByVal type As System.Reflection.MemberTypes, ByVal bindingAttr As System.Reflection.BindingFlags) As System.Reflection.MemberInfo()        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.GetMember(name, type, bindingAttr)    End Function    ''' <summary>    '''     ''' </summary>    ''' <param name="c"></param>    ''' <returns>Return Value    ''' true if the c parameter and the current Type represent the same type, or if the current Type is in     ''' the inheritance hierarchy of c, or if the current Type is an interface that c supports. false if     ''' none of  these conditions are the case, or if c is a null reference (Nothing in Visual Basic).    ''' </returns>    ''' <remarks></remarks>    Public Overrides Function IsAssignableFrom(ByVal c As System.Type) As Boolean        Dim result As Boolean        Helper.Assert(m_Declaration IsNot Nothing)        If m_Declaration.TypeBuilder IsNot Nothing Then            result = m_Declaration.TypeBuilder.IsAssignableFrom(c)        ElseIf TypeOf c Is IType = False Then            result = False        Else            Helper.NotImplemented()        End If        DumpMethodInfo(result)        Return result    End Function    Protected Overrides Function IsContextfulImpl() As Boolean        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.IsContextfulImpl()    End Function    Public Overrides Function IsInstanceOfType(ByVal o As Object) As Boolean        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.IsInstanceOfType(o)    End Function    Protected Overrides Function IsMarshalByRefImpl() As Boolean        DumpMethodInfo()        Helper.NotImplemented() : Return MyBase.IsMarshalByRefImpl()    End Function    Public Overrides Function IsSubclassOf(ByVal c As System.Type) As Boolean        Dim result As Boolean        If Helper.CompareType(c, Compiler.TypeCache.System_Object) Then Return True        Dim base As Type = Me.BaseType        Do While base IsNot Nothing            If Helper.CompareType(base, c) Then                result = True                Exit Do            End If            base = base.BaseType        Loop        DumpMethodInfo(result)        Return result    End Function    Protected Overrides Function IsValueTypeImpl() As Boolean        DumpMethodInfo()        Return MyBase.IsValueTypeImpl()    End Function    Public Overrides Function MakeArrayType() As System.Type        Dim result As Type        result = MakeArrayType(1)        DumpMethodInfo(result)        Return result    End Function    Public Overrides Function MakeArrayType(ByVal rank As Integer) As System.Type        Dim result As Type = Nothing        If m_Declaration IsNot Nothing Then            result = New ArrayTypeDescriptor(Me, rank)        ElseIf TypeOf Me Is GenericTypeDescriptor Then            result = New ArrayTypeDescriptor(Me, rank)        ElseIf TypeOf Me Is ArrayTypeDescriptor Then            result = New ArrayTypeDescriptor(Me, rank)        Else            Helper.NotImplemented()        End If        'Needs to add this to a cache, otherwise two otherwise equal types might be created with two different         'type instances, which is not good is any type comparison would fail.        Static cache As New Generic.Dictionary(Of String, Type)(NameResolution.StringComparer)        If cache.ContainsKey(result.FullName) Then            result = cache.Item(result.FullName)        Else            cache.Add(result.FullName, result)        End If        DumpMethodInfo(result)        Return result    End Function    Public Overrides Function MakeByRefType() As System.Type        Static result As Type = Nothing        If result Is Nothing Then            result = New ByRefTypeDescriptor(Me.Parent, Me)        End If        DumpMethodInfo(result)        Return result    End Function    Public Overrides Function MakeGenericType(ByVal ParamArray typeArguments() As System.Type) As System.Type        Dim result As Type = Nothing        result = Compiler.TypeManager.MakeGenericType(m_Declaration, m_Declaration.TypeDescriptor, typeArguments)        DumpMethodInfo(result)        Return result    End Function    Public Overrides Function MakePointerType() As System.Type        Dim result As Type = Nothing        Helper.NotImplemented()        DumpMethodInfo(result)        Return result    End Function    Public Overrides ReadOnly Property MemberType() As System.Reflection.MemberTypes        Get            Dim result As MemberTypes            result = MemberTypes.TypeInfo            Dim tmp As MemberTypes = MyBase.MemberType            Helper.Assert(result = tmp)            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property MetadataToken() As Integer        Get            Dim result As Integer            DumpMethodInfo(result)            Helper.NotImplemented()            Return result        End Get    End Property    Public Overrides ReadOnly Property ReflectedType() As System.Type        Get            Dim result As Type = Nothing            DumpMethodInfo(result)            Helper.NotImplemented()            Return result        End Get    End Property    Public Overrides ReadOnly Property StructLayoutAttribute() As System.Runtime.InteropServices.StructLayoutAttribute        Get            Dim result As Runtime.InteropServices.StructLayoutAttribute = Nothing            DumpMethodInfo(result)            Helper.NotImplemented()            Return result        End Get    End Property    Public Overrides ReadOnly Property TypeHandle() As System.RuntimeTypeHandle        Get            Dim result As RuntimeTypeHandle            DumpMethodInfo(result)            Helper.NotImplemented()            Return result        End Get    End Property#End RegionEnd Class

⌨️ 快捷键说明

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