private void EditColumnsAsList_Click(object sender, EventArgs e) { var avail = this._availableColumns.Where(z => !z.IsAlwaysEmpty).ToArray(); IEnumerable <Column> selected = FrmEditColumns.Show(this.ListView.FindForm(), avail, avail.Where(z => z.Visible), "Visible columns"); if (selected == null) { return; } this._availableColumns.ForEach(z => z.Visible = z.IsAlwaysEmpty || selected.Contains(z)); this.SaveColumnUserPreferences(); this.Rebuild(EListInvalids.ToggleColumn); }
private void InsertMacro(object sender, CtlTextBox textBox) { ColumnCollection available = ColumnManager.GetColumns(_dataType, _core); IEnumerable <Column> columns = FrmEditColumns.Show(this.FindForm(), available, (IEnumerable <Column>)null, "Insert field(s)"); if (columns == null) { return; } string text = string.Join(", ", columns.Select(z => z.DisplayName + " = {" + z.Id + "}")); textBox.TypeText(text); }
private void _btnColour_DropDownOpening(object sender, EventArgs e) { ToolStripDropDownButton tsddb = (ToolStripDropDownButton)sender; IEnumerable <Column> columns; Column selected; bool isColour = tsddb == this._btnColour; SourceSet ss = isColour ? this._colourBy : this._regressAgainst; switch (this.WhatPlotting) { case EPlotting.Peaks: columns = ColumnManager.GetColumns <Peak>(this._core); selected = ss._colourByPeak; break; case EPlotting.Observations: columns = ColumnManager.GetColumns <ObservationInfo>(this._core); selected = ss._colourByObervation; break; default: throw new SwitchException(this.WhatPlotting); } selected = FrmEditColumns.Show(this, columns, selected, isColour ? "Colour by" : "Regress against"); if (selected == null) { return; } if (isColour) { this.ColourBy(this._colourBy, selected); this.UpdatePlot(); } else { this.ColourBy(this._regressAgainst, selected); this.ColourBy(this._colourBy, selected); this.UpdateScores(); } }