AspBlock.Detached
event · AspBlock · cAlgo.API
DesktopCLICloud
Occurs when block is detached.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
event Action<AspBlockDetachedEventArgs> Detached;
aspBlock.Detached += handler # handler(obj: AspBlockDetachedEventArgs)
Examples
protected override void OnStart()
{
var block = Asp.SymbolTab.AddBlock("My Block");
block.Detached += OnBlockDetached;
}
private void OnBlockDetached(AspBlockDetachedEventArgs args)
{
Print("Block detached: {0}", args.AspBlock.Title);
}
def on_start(self):
block = api.Asp.SymbolTab.AddBlock("My Block")
block.Detached += self.on_block_detached
def on_block_detached(self, args):
api.Print(f"Block detached: {args.AspBlock.Title}")