2

RealBasicのイントロスペクションは、私が予想していたものとは少し異なります。

私の意図は:

単純化するために、他のオブジェクトが2つまたは3つのメソッドを継承するMainObjectを作成します。

Method 1-> Returns to the child class itself all of its properties, types and values.

Method 2-> Would call Method1 and with the information, save the child Object.

そこで、メソッド1については、各子クラスに対して、メソッド2がその作業を行うために必要なものを簡単に返す一般化されたイントロスペクションを作成することを考えました。

なぜこれが欲しいのですか?だから私は何十ものオブジェクトを保存する方法を知っていることができ、プロパティなどのあちこちの変更についてあまり心配することなく自分自身を描くことができます...

しかし、RealBasicチュートリアルとリファレンスが提供するものを使用すると、オブジェクトの外部などで発生する必要があるため、機能しません...つまり、ObjectAの内部で、ObjectBのプロパティ、メソッドなどを簡単に取得できますが、内部に入りたいObjectA、BではなくAのプロパティ

前もって感謝します...

4

1 に答える 1

2

私は方法を見つけました...非常に簡単です。MainClassを作成し、その中に配列、辞書などを返すことができる単純なメソッドWhoAmIを作成します...

  Dim thisClassTypeInfo As Introspection.TypeInfo = Introspection.GetType(Self)

  Dim thisClassProperties() As Introspection.PropertyInfo = thisClassTypeInfo.GetProperties

  Dim thisClassMethods() As Introspection.MethodInfo = thisClassTypeInfo.GetMethods


  For Each myProperty As Introspection.PropertyInfo In thisClassProperties

// Then here use myProperty.Name, myProperty.Value(Self).StringValue
// or myProperty.Value(Self).anyotheroption and create a dictionary 
// or array with the results and return it.

  Next
于 2012-12-26T08:37:04.630 に答える