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

📄 generictypedescriptor.vb

📁 大名鼎鼎的mono是.NET平台的跨平台(支持linux
💻 VB
📖 第 1 页 / 共 2 页
字号:
                        Throw New InternalException(Me)                    End If                Next            End If            Return m_AllDeclaredMembers        End Get    End Property    Protected Overrides ReadOnly Property AllMembers() As System.Collections.Generic.List(Of System.Reflection.MemberInfo)        Get            If m_AllMembers Is Nothing Then                Helper.Assert(m_OpenType IsNot Nothing)                m_AllMembers = New Generic.List(Of MemberInfo)                m_AllMembers.AddRange(m_OpenType.GetMembers(Helper.ALLMEMBERS))                For i As Integer = 0 To m_AllMembers.Count - 1                    Dim minfo As MethodInfo = TryCast(m_AllMembers(i), MethodInfo)                    Dim cinfo As ConstructorInfo = TryCast(m_AllMembers(i), ConstructorInfo)                    Dim finfo As FieldInfo = TryCast(m_AllMembers(i), FieldInfo)                    Dim pinfo As PropertyInfo = TryCast(m_AllMembers(i), PropertyInfo)                    Dim tinfo As Type = TryCast(m_AllMembers(i), Type)                    If minfo IsNot Nothing Then                        m_AllMembers(i) = Compiler.TypeManager.MakeGenericMethod(Me.Parent, minfo, m_TypeParameters, m_TypeArguments, Me)                    ElseIf cinfo IsNot Nothing Then                        m_AllMembers(i) = Compiler.TypeManager.MakeGenericConstructor(Me.Parent, cinfo, m_TypeParameters, m_TypeArguments, Me)                    ElseIf finfo IsNot Nothing Then                        m_AllMembers(i) = Compiler.TypeManager.MakeGenericField(Me.Parent, finfo, m_TypeParameters, m_TypeArguments, Me)                    ElseIf pinfo IsNot Nothing Then                        m_AllMembers(i) = Compiler.TypeManager.MakeGenericProperty(Me.Parent, pinfo, m_TypeParameters, m_TypeArguments, Me)                    ElseIf tinfo IsNot Nothing Then                        m_AllMembers(i) = Compiler.TypeManager.MakeGenericType(Me.Parent, tinfo, m_TypeArguments)                    Else                        Throw New InternalException(Me)                    End If                Next                Helper.AddMembers(Compiler, Me, m_AllMembers, Helper.GetBaseMembers(Compiler, Me))            End If            Return m_AllMembers        End Get    End Property    Protected Overrides Function GetAttributeFlagsImpl() As System.Reflection.TypeAttributes        Dim result As TypeAttributes        result = m_OpenType.Attributes        DumpMethodInfo(result)        Return result    End Function    ReadOnly Property TypeArguments() As Type()        Get            Return m_TypeArguments        End Get    End Property    Public Overrides Function GetGenericTypeDefinition() As System.Type        Dim result As Type        result = m_OpenType        If result.IsGenericTypeDefinition = False Then            result = result.GetGenericTypeDefinition        End If        DumpMethodInfo(result)        Return result    End Function    Public Overrides ReadOnly Property IsGenericParameter() As Boolean        Get            Dim result As Boolean            result = False            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property IsGenericType() As Boolean        Get            Dim result As Boolean            result = True            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property IsGenericTypeDefinition() As Boolean        Get            Dim result As Boolean            result = False            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property FullName() As String        Get            Dim result As String            If m_FullName Is Nothing Then                Dim name As String = Me.Name                Dim tmp As Type = m_OpenType.DeclaringType                Do While tmp IsNot Nothing                    name = tmp.Name & "+" & name                    tmp = tmp.DeclaringType                Loop                If Me.Namespace <> "" Then                    m_FullName = Me.Namespace & "." & name                Else                    m_FullName = name                End If            End If            result = m_FullName            DumpMethodInfo(result)            Helper.Assert(result.IndexOf("\"c) = -1)            Return result        End Get    End Property    Overrides ReadOnly Property Name() As String        Get            Dim result As String            If m_Name Is Nothing Then                Dim builder As New System.Text.StringBuilder                builder.Append(m_OpenType.Name)                For i As Integer = 0 To builder.Length - 1                    If builder.Chars(i) = "["c Then                        builder.Length = i                        Exit For                    End If                Next                '                If builder..IndexOf("[") > -1 Then m_Name = m_Name.Substring(0, m_Name.IndexOf("["))                builder.Append("[")                For i As Integer = 0 To m_TypeArguments.Length - 1                    If m_TypeArguments(i).FullName = String.Empty Then                        builder.Append(m_TypeArguments(i).Name)                    Else                        builder.Append(m_TypeArguments(i).FullName)                    End If                    If i < m_TypeArguments.Length - 1 Then builder.Append(",")                Next                builder.Append("]")                m_Name = builder.ToString            End If            result = m_Name            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property BaseType() As System.Type        Get            Static result As Type = Nothing            If result Is Nothing Then                Helper.Assert(m_OpenType IsNot Nothing)                result = m_OpenType.BaseType                If result IsNot Nothing Then                    result = Helper.ApplyTypeArguments(Parent, result, m_TypeParameters, m_TypeArguments)                End If            End If            DumpMethodInfo(result)            Return result        End Get    End Property    Protected Overrides Function HasElementTypeImpl() As Boolean        Dim result As Boolean        result = False        DumpMethodInfo(result)        Return result    End Function    Public Overrides ReadOnly Property UnderlyingSystemType() As System.Type        Get            Dim result As Type            result = Me            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides ReadOnly Property ContainsGenericParameters() As Boolean        Get            Dim result As Boolean            result = False            For Each arg As Type In m_TypeArguments                If arg.IsGenericParameter Then                    result = True                    Exit For                End If            Next            DumpMethodInfo(result)            Return result        End Get    End Property    Public Overrides Function GetGenericArguments() As System.Type()        Dim result As Type() = Nothing        result = m_TypeArguments        DumpMethodInfo(result)        Return result    End Function    Public Overrides Function MakeGenericType(ByVal ParamArray typeArguments() As System.Type) As System.Type        Dim result As Type = Nothing        Throw New InvalidOperationException("Not a generic type definition")        DumpMethodInfo(result)        Return result    End FunctionEnd Class

⌨️ 快捷键说明

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