public ToolBarConnector(ButtonAction action, ButtonToolItem toolBarButton) { this.toolBarButton = toolBarButton; this.toolBarButton.Click += toolBarButton_Click; this.action = action; this.action.EnabledChanged += new EventHandler <EventArgs>(action_EnabledChanged).MakeWeak(e => this.action.EnabledChanged -= e); }
public override ToolItem GenerateToolBarItem(ActionItem actionItem, Generator generator, ToolBarTextAlign textAlign) { var tbb = new ButtonToolItem(generator); tbb.ID = ID; tbb.Enabled = Enabled; if (ShowLabel || actionItem.ShowLabel || textAlign != ToolBarTextAlign.Right) { tbb.Text = ToolBarText; } //Console.WriteLine("Adding toolbar {0}", ToolBarText); if (Image != null) { tbb.Image = Image; } if (!string.IsNullOrEmpty(ToolBarItemStyle)) { tbb.Style = ToolBarItemStyle; } new ToolBarConnector(this, tbb); return(tbb); }
public override ToolItem GenerateToolBarItem(ActionItem actionItem, Generator generator, ToolBarTextAlign textAlign) { var tbb = new ButtonToolItem(generator); tbb.ID = ID; tbb.Enabled = Enabled; if (ShowLabel || actionItem.ShowLabel || textAlign != ToolBarTextAlign.Right) tbb.Text = ToolBarText; //Console.WriteLine("Adding toolbar {0}", ToolBarText); if (Image != null) tbb.Image = Image; if (!string.IsNullOrEmpty (ToolBarItemStyle)) tbb.Style = ToolBarItemStyle; new ToolBarConnector(this, tbb); return tbb; }
public ToolBarConnector(ButtonAction action, ButtonToolItem toolBarButton) { this.toolBarButton = toolBarButton; this.toolBarButton.Click += toolBarButton_Click; this.action = action; this.action.EnabledChanged += new EventHandler<EventArgs>(action_EnabledChanged).MakeWeak(e => this.action.EnabledChanged -= e); }