Last change
on this file since 432 was 400, checked in by イグトランス (egtra), 17 years ago |
_System_CThreadCollectionでのクラスインスタンスへのポインタの使用を除去、参照変数構文へ。
|
File size:
980 bytes
|
Rev | Line | |
---|
[385] | 1 | 'Classes/ActiveBasic/misc.ab
|
---|
| 2 |
|
---|
| 3 | Namespace ActiveBasic
|
---|
[400] | 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 |
|
---|
[385] | 32 | Function IsNothing(o As Object) As Boolean
|
---|
| 33 | Return Object.ReferenceEquals(o, Nothing)
|
---|
| 34 | End Function
|
---|
| 35 | End Namespace
|
---|
Note:
See
TracBrowser
for help on using the repository browser.