/// <summary> /// Constructor /// </summary> /// <param name="factory">The UI factory</param> public ToolsDiagram(IUIFactory factory) { StaticExtensionDiagramUISerializable.Init(); handler = new ToolBarButtonClickEventHandler(this.ToolBar_ButtonClick); this.factory = factory; factory.Tools = this; }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// toolbarbuttonclickeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this ToolBarButtonClickEventHandler toolbarbuttonclickeventhandler, Object sender, ToolBarButtonClickEventArgs e, AsyncCallback callback) { if (toolbarbuttonclickeventhandler == null) { throw new ArgumentNullException("toolbarbuttonclickeventhandler"); } return(toolbarbuttonclickeventhandler.BeginInvoke(sender, e, callback, null)); }
/// <summary> /// Overrides <see cref="CommandExecutor{T}.OnInstanceAdded(T, Command)"/> and hooks ToolBarButton.Click Event /// </summary> /// <param name="item">A ToolBarButton</param> /// <param name="cmd">The <see cref="Command"/> associated with the <paramref name="item"/></param> protected internal override void OnInstanceAdded(System.Windows.Forms.ToolBarButton item, Command cmd) { ToolBarButtonClickEventHandler handler = new ToolBarButtonClickEventHandler(toolbar_ButtonClick); // Attempt to remove the handler first, in case we have already // signed up for the event in this toolbar item.Parent.ButtonClick -= handler; item.Parent.ButtonClick += new ToolBarButtonClickEventHandler(toolbar_ButtonClick); base.OnInstanceAdded(item, cmd); }
/// <summary> /// /// </summary> /// <param name="item"></param> /// <param name="cmd"></param> public override void InstanceAdded(object item, Command cmd) { ToolBarButton button = (ToolBarButton)item; ToolBarButtonClickEventHandler handler = new ToolBarButtonClickEventHandler(toolbar_ButtonClick); // Attempt to remove the handler first, in case we have already // signed up for the event in this toolbar button.Parent.ButtonClick -= handler; button.Parent.ButtonClick += handler; base.InstanceAdded(item, cmd); }
public ShapeToolBar() { document = null; shapeFillColor = Color.FromArgb(150, 180, 210); images = new ImageList(); showImages = true; showText = false; applyToSelection = true; allowDrag = false; defaultBoxSize = new Size(20, 20); imageSize = new Size(16, 16); ButtonClick += new ToolBarButtonClickEventHandler(OnButtonClick); shapes = null; }
public ShapeToolBar() { document = null; shapeFillColor = Color.FromArgb(150, 180, 210); images = new ImageList(); showImages = true; showText = false; applyToSelection = true; allowDrag = false; defaultBoxSize = new Size(20, 20); imageSize = new Size(16, 16); ButtonClick += new ToolBarButtonClickEventHandler(OnButtonClick); shapes = null; }