Changeset 403 for trunk/Include


Ignore:
Timestamp:
Feb 12, 2008, 9:40:59 AM (17 years ago)
Author:
dai
Message:

・MemberInfoクラスを追加。
・KeyNotFoundExceptionクラスを追加。
TypeInfo.GetMembersメソッドを追加。
・TypeInfoテストケースを追加。

Location:
trunk/Include/Classes
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/ActiveBasic/Core/TypeInfo.ab

    r402 r403  
    1515    memberTypeFullNames As *String      ' 型名リスト
    1616    memberCounts As Long                ' 個数
     17    memberInfosCache As System.Collections.Generic.List<System.Reflection.MemberInfo>
    1718
    1819Protected
     
    108109    ' Public methods
    109110    '----------------------------------------------------------------
     111
     112    Override Function GetMembers() As System.Collections.Generic.List<System.Reflection.MemberInfo>
     113        If Object.ReferenceEquals( memberInfosCache, Nothing ) Then
     114            ' キャッシュにないときは生成する
     115            memberInfosCache = New System.Collections.Generic.List
     116            Dim i As Long
     117            For i=0 To ELM(memberCounts)
     118                memberInfosCache.Add( New System.Reflection.MemberInfo( memberNames[i], _System_TypeBase_Search( memberTypeFullNames[i] ) ) )
     119            Next
     120        End If
     121
     122        Return memberInfosCache
     123    End Function
    110124
    111125End Class
  • trunk/Include/Classes/System/Collections/Generic/Dictionary.ab

    r393 r403  
    5858            Next
    5959        End If
    60         debug
    61         'KeyNotFoundException
     60
     61        Throw New KeyNotFoundException
     62
    6263        Return Nothing
    6364    End Function
  • trunk/Include/Classes/System/Reflection/MemberInfo.ab

    r402 r403  
     1Namespace System
     2Namespace Reflection
     3
     4
     5Class MemberInfo
     6    name As String
     7    memberType As TypeInfo
     8Public
     9    Sub MemberInfo( name As String, memberType As TypeInfo )
     10        This.name = name
     11        This.memberType = memberType
     12    End Sub
     13
     14    Function Name() As String
     15        Return name
     16    End Function
     17
     18    Function MemberType() As TypeInfo
     19        Return memberType
     20    End Function
     21End Class
     22
     23
     24End Namespace
     25End Namespace
  • trunk/Include/Classes/System/TypeInfo.ab

    r275 r403  
    1 ' 実装中...
    2 '(※ まだ組み込んでいません)
    3 
    4 
    51Namespace System
    62
     
    4541    '----------------------------------------------------------------
    4642
     43    Abstract Function GetMembers() As System.Collections.Generic.List<System.Reflection.MemberInfo>
     44
    4745End Class
    4846
  • trunk/Include/Classes/index.ab

    r391 r403  
    2727#require "./System/Collections/Generic/Dictionary.ab"
    2828#require "./System/Collections/Generic/List.ab"
     29#require "./System/Collections/Generic/KeyNotFoundException.ab"
    2930/*
    3031#require "./System/Data/Odbc/Odbc.ab"
     
    7071#require "./System/Media/SystemSound.ab"
    7172#require "./System/Media/SystemSounds.ab"
     73#require "./System/Reflection/MemberInfo.ab"
    7274#require "./System/Runtime/InteropServices/GCHandle.ab"
    7375#require "./System/Security/AccessControl/misc.ab"
Note: See TracChangeset for help on using the changeset viewer.