private ListViewItem MakeListViewItem(ColumnSpec columnSpec) { var listViewItem = new ListViewItem(); var columnDescriptor = ParentColumn.ResolveDescendant(columnSpec.IdentifierPath); if (columnDescriptor == null) { listViewItem.Text = columnSpec.Caption ?? columnSpec.IdentifierPath.Name; listViewItem.Font = _strikeThroughFont; } else { listViewItem.Text = columnDescriptor.DisplayName; } return(listViewItem); }
private void UpdatePropertySheet() { var helper = GetColumnListHelper(); var selectedColumns = helper.GetSelectedItems(); if (selectedColumns.Length == 1) { var selectedColumn = selectedColumns[0]; groupBoxCaption.Visible = true; if (selectedColumn.Caption != null) { tbxCaption.Text = selectedColumn.Caption; tbxCaption.Font = new Font(tbxCaption.Font, FontStyle.Bold); } else { var columnDescriptor = ParentColumn.ResolveDescendant(selectedColumn.IdentifierPath); if (columnDescriptor != null) { tbxCaption.Text = columnDescriptor.DefaultCaption; tbxCaption.Font = new Font(tbxCaption.Font, FontStyle.Regular); } else { tbxCaption.Text = ""; } } availableFieldsTreeColumns.SelectColumn(selectedColumn.IdentifierPath); } else { groupBoxCaption.Visible = false; } btnRemove.Enabled = selectedColumns.Length > 0; btnUp.Enabled = helper.IsMoveUpEnabled(); btnDown.Enabled = helper.IsMoveDownEnabled(); listViewColumns_SizeChanged(listViewColumns, new EventArgs()); UpdateSublistCombo(); }
private void tbxCaption_Leave(object sender, EventArgs e) { if (_inChangeView) { return; } var columnSpecs = GetSelectedColumns(); if (columnSpecs.Length != 1) { return; } string newValue = tbxCaption.Text; if (Equals(newValue, columnSpecs[0].Caption)) { return; } var columnDescriptor = ParentColumn.ResolveDescendant(columnSpecs[0].IdentifierPath); if (columnDescriptor != null) { if (Equals(newValue, columnDescriptor.DefaultCaption)) { newValue = null; } } if (Equals(newValue, columnSpecs[0].Caption)) { return; } var newColumns = ViewSpec.Columns.ToArray(); newColumns[listViewColumns.SelectedIndices[0]] = columnSpecs[0].SetCaption(newValue); ViewSpec = ViewSpec.SetColumns(newColumns); }
public long GetParentTableKey() { return(ParentColumnKey ?? ParentColumn.GetParentTableKey()); }
public override void UnSelect() { ChildColumn.UnSelect(); ParentColumn.UnSelect(); }
private void btnAddColumn_Click(object sender, EventArgs e) { AddColumns(availableFieldsTreeColumns.CheckedColumns .Select(id => ParentColumn.ResolveDescendant(id))); }