Skip to content

AspBlockDetachedEventArgs.AspBlock

property · AspBlockDetachedEventArgs · cAlgo.API

DesktopCLICloud

Detached block.

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

public AspBlock AspBlock {get;}
aspBlockDetachedEventArgs.AspBlock: AspBlock

Returns AspBlock

Examples

protected override void OnStart()
{
    var block = Asp.SymbolTab.AddBlock("My Block");
    block.IsDetachable = true;
    block.Detached += OnBlockDetached;
}

private void OnBlockDetached(AspBlockDetachedEventArgs args)
{
    Print("Block {0} attached: {1}", args.AspBlock.Id, args.AspBlock.IsAttached);
}
def on_start(self):
    block = api.Asp.SymbolTab.AddBlock("My Block")
    block.IsDetachable = True
    block.Detached += self.on_block_detached

def on_block_detached(self, args):
    api.Print(f"Block {args.AspBlock.Id} attached: {args.AspBlock.IsAttached}")