switch クラス : IsAttached ゲッタ
説明
ハンドラがイベント処理システムに接続されているかどうかを示す値を返します。
構文
instance.IsAttached
引数
無し。
返り値
| クラス | 説明 |
| bool | ハンドラがイベント処理システムに接続されているかどうかを示す値。 |
サンプルコード
次のクラス定義があるとします。
| 1: | class handle |
| 2: | open method void LCHandler(dictionary dic) |
| 3: | ... // event handler code. |
| 4: | endmethod |
| 5: | endclass |
IsAttached ゲッターの使い方は次のとおりです。
| 1: | browser b = new browser(); |
| 2: | handle h = new handle(); |
| 3: | switch sw = b.LoadCompleted(h,"LCHandler(dictionary)"); // The handler is automatically attached. |
| 4: | bool att = sw.IsAttached; // "true" |
| 5: | sw.Detach(); // Detach the handler. |
| 6: | att = sw.IsAttach; // false; |
| 7: | sw.Attach(); // Re-attach the handler. |
| 8: | att = sw.IsAttach; // true; |
注意
返り値は以下の様になります。
ハンドラ割り当てメソッド経由でインスタンスを取得した場合はハンドラとイベント処理システムは自動的に接続されるのでtrueを返します。
Detach()メソッド呼び出した後はfalseを返します。
Attach()メソッド呼び出した後はtrueを返します。
イベント処理の実装は、Cooker ver3.0.3で変更されています。このゲッタはその変更に伴い追加されました。
参照リンク
無し。


