Exemple #1
0
        private void editItem(object key, object element)
        {
            int index = getIndexFromKey(key);

            Collection[index] = new DictionaryElement(StringConv, Collection[index].Key, element);
            OnMemberChanged?.Invoke();
        }
Exemple #2
0
 public void btnDelete_Click()
 {
     if (SelectedIndex > -1 && SelectedIndex < Collection.Count)
     {
         Collection.RemoveAt(SelectedIndex);
         OnMemberChanged?.Invoke();
     }
 }
Exemple #3
0
 private void btnDown_Click()
 {
     if (SelectedIndex > -1 && SelectedIndex < Collection.Count - 1)
     {
         int index = SelectedIndex;
         Switch(SelectedIndex, SelectedIndex + 1);
         SelectedIndex = index + 1;
         OnMemberChanged?.Invoke();
     }
 }
Exemple #4
0
 private void btnUp_Click()
 {
     if (SelectedIndex > 0)
     {
         int index = SelectedIndex;
         Switch(SelectedIndex, SelectedIndex - 1);
         SelectedIndex = index - 1;
         OnMemberChanged?.Invoke();
     }
 }
Exemple #5
0
 private void insertItem(int index, object element)
 {
     index = Math.Min(Math.Max(0, index), Collection.Count + 1);
     Collection.Insert(index, new ListElement(StringConv, AddIndex, index, element));
     for (int ii = index + 1; ii < Collection.Count; ii++)
     {
         Collection[ii].Key = ii;
     }
     OnMemberChanged?.Invoke();
 }
Exemple #6
0
 private void btnDelete_Click()
 {
     if (SelectedIndex > -1 && SelectedIndex < Collection.Count)
     {
         int index = SelectedIndex;
         Collection.RemoveAt(SelectedIndex);
         for (int ii = index; ii < Collection.Count; ii++)
         {
             Collection[ii].Key = ii;
         }
         OnMemberChanged?.Invoke();
     }
 }
Exemple #7
0
 private void insertItem(object key, object element)
 {
     Collection.Add(new DictionaryElement(StringConv, key, element));
     OnMemberChanged?.Invoke();
 }
Exemple #8
0
 private void editItem(int index, object element)
 {
     index             = Math.Min(Math.Max(0, index), Collection.Count);
     Collection[index] = new ListElement(StringConv, AddIndex, index, element);
     OnMemberChanged?.Invoke();
 }