Changeset 400 for trunk/Include/Classes/ActiveBasic/misc.ab
- Timestamp:
- Jan 22, 2008, 9:19:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/ActiveBasic/misc.ab
r385 r400 2 2 3 3 Namespace ActiveBasic 4 Namespace Detail 5 /*! 6 @brief baseがderivedの基底クラスかどうか判定する。 7 @param[in] base 基底クラス 8 @param[in] derived 派生クラス 9 @retval True baseがderivedの基底クラスである 10 @retval False 基底クラスでない 11 @exception ArgumentNullException 引数のどちらか又は双方がNoghing 12 @auther Egtra 13 @date 2008/01/21 14 */ 15 Function IsBaseOf(base As System.TypeInfo, derived As System.TypeInfo) As Boolean 16 Imports System 17 If IsNothing(base) Then 18 Throw New ArgumentNullException("base") 19 ElseIf IsNothing(derived) Then 20 Throw New ArgumentNullException("derived") 21 End If 22 Do 23 IsBaseOf = derived.Equals(base) 24 If IsBaseOf Then 25 Exit Function 26 End If 27 derived = derived.BaseType 28 Loop Until IsNothing(derived) 29 End Function 30 End Namespace 31 4 32 Function IsNothing(o As Object) As Boolean 5 33 Return Object.ReferenceEquals(o, Nothing)
Note:
See TracChangeset
for help on using the changeset viewer.