switch クラス : Detach()メソッド
説明
イベント処理システムからハンドラーを切り離します。
構文
instance.Detach()
引数
無し。
返り値
無し。
サンプルコード
次のクラス定義があるとします。
| 1: | class handle |
| 2: | open method void LCHandler(dictionary dic) |
| 3: | ... // event handler code. |
| 4: | endmethod |
| 5: | endclass |
Detach() メソッドの使い方は次のとおりです。
| 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.IsAttach; // true; |
| 5: | sw.Detach(); // Detach the handler. |
| 6: | att = sw.IsAttach; // false; |
注意
イベントハンドラの実行を停止してハンドラをイベント処理システムから切り離します。
スクリプトのexitポイントでハンドラを取り除く場合はこのメソッドを呼び出してください。
切り離し済みの場合はメソッドの再呼び出しは無視されます。
イベント処理の実装は、Cooker ver3.0.3で変更されています。このメソッドはその変更に伴い追加されました。
参照リンク
無し。


