Beispiel #1
0
        public void DeleteItem(ExtendedComboBoxItem item)
        {
            if (item.Equals(m_addItem))
            {
                return;
            }

            int itemIndex = Items.IndexOf(item);
            if (itemIndex > -1)
            {
                this.Items.Remove(item);
                if (itemIndex > 0)
                {
                    this.SelectedIndex = itemIndex - 1;
                }
                else if (Items.Count > 1)
                {
                    this.SelectedIndex = 0;
                }
                else
                {
                    this.SelectedIndex = -1;
                }
            }
        }
Beispiel #2
0
        public void InsertItemAtIndex(int index, ExtendedComboBoxItem item)
        {
            if (index > this.Items.Count - 1)
            {
                Utilities.ErrorMessage errorMessage = new Utilities.ErrorMessage(
                    "INVALID_INDEX",
                    "Workshare.PolicyDesigner.Properties.Resources",
                    System.Reflection.Assembly.GetExecutingAssembly());
				Logger.LogError(errorMessage.LogString);
				throw new ArgumentException(errorMessage.DisplayString);
            }

            this.Items.Insert(index, item);
        }
Beispiel #3
0
 public void InsertItem(ExtendedComboBoxItem item)
 {
     this.InsertItemAtIndex((this.Items.Count - 1), item);
 }