/// <summary> /// Called by the toolbar to update the state of the specified toolbar item. /// </summary> private void OnValidateToolbarItem(object sender, CRToolbarItemEventArgs args) { CRRoundButton button = args.Item.Control as CRRoundButton; if (button != null) { button.Enabled = CanAction(args.Item.ID); } else { args.Item.Control.Enabled = CanAction(args.Item.ID); } }
/// <summary> /// Called by the toolbar when the user clicks a button. /// </summary> private void OnActionToolbarItem(object sender, CRToolbarItemEventArgs args) { switch (args.Item.ID) { case ActionID.Script: RunScript((string)args.Item.ExtraData); break; default: Action(args.Item.ID); break; } }