private void Field_FieldSelectionChanged(object sender, FieldSelectionChangedEventArgs e) { var reportField = e.ChangedReportField; if (reportField.IsSelected) SelectedFields.Add(new ReportField { DisplayName = reportField.DisplayName, Name = reportField.Name }); else SelectedFields.Remove(SelectedFields.Where((fld) => fld.Name == reportField.Name).FirstOrDefault()); }
private void listViewEx1_ItemChecked(object sender, ItemCheckedEventArgs e) { SelectedFields.Clear(); foreach (ListViewItem item in listViewEx1.Items) { if (item != null && item.Checked && _ExportableFields.Contains(item.Text)) { SelectedFields.Add(item.Text); } } }
/// <summary> /// Handler for when someone closes the dialog with the OK button /// </summary> /// <param name="obj"></param> private void OnOkButtonPressedCommand(object obj) { if (!string.IsNullOrWhiteSpace(SelectedField1)) { SelectedFields.Add(SelectedField1); } if (UseTwoFields && !string.IsNullOrWhiteSpace(SelectedField2)) { SelectedFields.Add(SelectedField2); } // close dialog DialogResult = true; }
public void MoveFields(FieldData[] fieldsData) { foreach (var field in fieldsData) { if (field.IsSelected) { field.IsSelected = false; AvailableFields.Add(field); SelectedFields.Remove(field); } else { field.IsSelected = true; AvailableFields.Remove(field); SelectedFields.Add(field); } } }
public Model(List <Field> fields, List <Constraint> constraints, List <Table> tables) { this._fields = fields; this._constraints = constraints; this._tables = tables; //Attach event on every Field this._fields.ForEach((field) => { if (field.IsSelected) { SelectedFields.Add(field); } else { field.OnSelectField += new Field.OnSelectFieldEventHandler((args) => { SelectedFields.Add(field); }); } }); }