public static ColumnDefinition GetColumnDefinition(string key)
        {
            // force initialize definition table
            StudyFilterColumn.SpecialColumnDefinitions.GetHashCode();

            if (_specialColumnDefinitions.ContainsKey(key))
            {
                return(_specialColumnDefinitions[key]);
            }

            // force initialize definition table
            StudyFilterColumn.DicomTagColumnDefinitions.GetHashCode();

            if (_dicomColumnDefinitions.ContainsKey(key))
            {
                return(_dicomColumnDefinitions[key]);
            }

            uint dicomTag;

            if (uint.TryParse(key, System.Globalization.NumberStyles.AllowHexSpecifier, System.Globalization.CultureInfo.InvariantCulture, out dicomTag))
            {
                return(StudyFilterColumn.GetColumnDefinition(dicomTag));
            }

            return(null);
        }
 public ColumnPickerComponent(IEnumerable <StudyFilterColumn> columns) : this()
 {
     foreach (StudyFilterColumn column in columns)
     {
         _columns.Add(StudyFilterColumn.GetColumnDefinition(column.Key));
     }
 }
            public void Deserialize(StringCollection columns)
            {
                if (columns != null)
                {
                    foreach (StudyFilterColumn column in _innerList)
                    {
                        column.Owner = null;
                    }

                    _innerList.Clear();
                    foreach (string columnKey in columns)
                    {
                        StudyFilterColumn column = StudyFilterColumn.CreateColumn(columnKey);
                        if (column != null)
                        {
                            _innerList.Add(column);
                        }
                    }
                    _owner.ColumnsChanged(_innerList);

                    foreach (StudyFilterColumn column in _innerList)
                    {
                        column.Owner = _owner;
                    }
                }
            }
            public void RemoveAt(int index)
            {
                StudyFilterColumn item = _innerList[index];

                _innerList.RemoveAt(index);
                _owner.ColumnRemoved(index, item);
                item.Owner = null;
            }
        public static StudyFilterColumn CreateColumn(string key)
        {
            ColumnDefinition definition = StudyFilterColumn.GetColumnDefinition(key);

            if (definition != null)
            {
                return(definition.Create());
            }
            return(null);
        }
 public void Insert(int index, StudyFilterColumn item)
 {
     if (_innerList.Contains(item))
     {
         throw new ArgumentException("Column already exists in collection.", "item");
     }
     _innerList.Insert(index, item);
     _owner.ColumnInserted(index, item);
     item.Owner = _owner;
 }
            public bool Remove(StudyFilterColumn item)
            {
                int index = _innerList.IndexOf(item);

                if (index >= 0)
                {
                    _innerList.RemoveAt(index);
                    _owner.ColumnRemoved(index, item);
                    item.Owner = null;
                    return(true);
                }
                return(false);
            }
            public StudyFilterColumn this[int index]
            {
                get { return(_innerList[index]); }
                set
                {
                    if (_innerList.Contains(value))
                    {
                        throw new ArgumentException("Column already exists in collection.", "value");
                    }

                    StudyFilterColumn item = _innerList[index];
                    _innerList[index] = value;
                    _owner.ColumnChanged(index, item, value);
                    item.Owner  = null;
                    value.Owner = _owner;
                }
            }
Example #9
0
 public ToolContext(StudyFilterColumn column)
 {
     _column = column;
 }
Example #10
0
 public ActionModelNode GetContextMenuActionModel(IStudyItem item, StudyFilterColumn column)
 {
     _toolContext.SetActiveCell(item, column);
     return(ActionModelRoot.CreateModel(this.GetType().FullName, StudyFilterTool.DefaultContextMenuActionSite, _actions));
 }
Example #11
0
 internal void SetActiveCell(IStudyItem item, StudyFilterColumn column)
 {
     _activeItem   = item;
     _activeColumn = column;
     EventsHelper.Fire(_activeChanged, this, EventArgs.Empty);
 }
Example #12
0
 private void ColumnChanged(int index, StudyFilterColumn oldColumn, StudyFilterColumn newColumn)
 {
     _table.Columns[index] = newColumn.CreateTableColumn();
 }
Example #13
0
 private void ColumnRemoved(int index, StudyFilterColumn oldColumn)
 {
     _table.Columns.RemoveAt(index);
 }
Example #14
0
 private void ColumnInserted(int index, StudyFilterColumn newColumn)
 {
     _table.Columns.Insert(index, newColumn.CreateTableColumn());
 }
 public int IndexOf(StudyFilterColumn item)
 {
     return(_innerList.IndexOf(item));
 }
 public bool Contains(StudyFilterColumn item)
 {
     return(_innerList.Contains(item));
 }