private void _btnMoveColumnDown_Click(object sender, EventArgs e) { if (_lstSelectedColumns.SelectedItem != null) { int index = _lstSelectedColumns.SelectedIndex; int newIndex = index + 1; StudyFilterColumn.ColumnDefinition column = (StudyFilterColumn.ColumnDefinition)_lstSelectedColumns.SelectedItem; if (newIndex < _lstSelectedColumns.Items.Count) { _lstSelectedColumns.Items.RemoveAt(index); _lstSelectedColumns.Items.Insert(newIndex, column); _lstSelectedColumns.SelectedIndex = newIndex; _component.Columns.RemoveAt(index); _component.Columns.Insert(newIndex, column); } } }
private void OnAddDicomTagClick(object sender, EventArgs e) { try { ushort group = ushort.Parse(_txtDicomTagGroup.Text, NumberStyles.AllowHexSpecifier); ushort element = ushort.Parse(_txtDicomTagElement.Text, NumberStyles.AllowHexSpecifier); uint tag = (uint)(group << 16) + element; StudyFilterColumn.ColumnDefinition column = StudyFilterColumn.GetColumnDefinition(tag); if (_lstSelectedColumns.Items.Contains(column)) { return; } _lstSelectedColumns.Items.Add(column); _component.Columns.Add(column); } catch (FormatException) {} }
private void OnAddDicomColumnClick(object sender, EventArgs e) { if (_lstDicomColumns.SelectedItems != null && _lstDicomColumns.SelectedItems.Count > 0) { foreach (object selectedItem in _lstDicomColumns.SelectedItems) { StudyFilterColumn.ColumnDefinition column = selectedItem as StudyFilterColumn.ColumnDefinition; if (column == null) { continue; } if (_lstSelectedColumns.Items.Contains(column)) { continue; } _lstSelectedColumns.Items.Add(column); _component.Columns.Add(column); } } }