public ToolBarConnector(CheckAction action, CheckToolItem 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); this.action.CheckedChanged += new EventHandler <EventArgs>(action_CheckedChanged).MakeWeak(e => this.action.CheckedChanged -= e); }
public override ToolItem GenerateToolBarItem(ActionItem actionItem, Generator generator, ToolBarTextAlign textAlign) { var tbb = new CheckToolItem(generator); tbb.ID = ID; tbb.Checked = Checked; tbb.Enabled = Enabled; if (ShowLabel || actionItem.ShowLabel || textAlign != ToolBarTextAlign.Right) { tbb.Text = 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 CheckToolItem(generator); tbb.ID = ID; tbb.Checked = Checked; tbb.Enabled = Enabled; if (ShowLabel || actionItem.ShowLabel || textAlign != ToolBarTextAlign.Right) tbb.Text = ToolBarText; if (Image != null) tbb.Image = Image; if (!string.IsNullOrEmpty (ToolBarItemStyle)) tbb.Style = ToolBarItemStyle; new ToolBarConnector(this, tbb); return tbb; }
public ToolBarConnector(CheckAction action, CheckToolItem 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); this.action.CheckedChanged += new EventHandler<EventArgs>(action_CheckedChanged).MakeWeak(e => this.action.CheckedChanged -= e); }