public TasksListController(TasksListControl control) { this.control = control; if (this.control != null) { this.control.GridControl.SelectionChanged += this.GridControl_SelectionChanged; this.control.ViewButton.Click += this.ViewButton_Click; this.control.ViewButtonMenu.Items.AddRange( Helpers.GetEnumValuesDescriptionPairs<ViewState>(). Select(pair => { var menuItem = new ToolStripMenuItem(pair.Value); menuItem.Tag = pair.Key; menuItem.Click += this.menuItem_Click; return menuItem; }).ToArray()); this.SetupTableView(); } }
private ViewState currentViewState = ViewState.TaskName; // the default value is Task name only public TasksListController(TasksListControl control) { this.control = control; if (this.control != null) { this.control.GridControl.SelectionChanged += this.GridControl_SelectionChanged; this.control.ViewButton.Click += this.ViewButton_Click; this.control.ViewButtonMenu.Items.AddRange( Helpers.GetEnumValuesDescriptionPairs <ViewState>(). Select(pair => { var menuItem = new ToolStripMenuItem(pair.Value); menuItem.Tag = pair.Key; menuItem.Click += this.menuItem_Click; return(menuItem); }).ToArray()); this.SetupTableView(); } }