コード例 #1
0
        private void editItem(object key, object element)
        {
            int index = getIndexFromKey(key);

            Collection[index] = new DictionaryElement(StringConv, Collection[index].Key, element);
            OnMemberChanged?.Invoke();
        }
コード例 #2
0
 public void btnDelete_Click()
 {
     if (SelectedIndex > -1 && SelectedIndex < Collection.Count)
     {
         Collection.RemoveAt(SelectedIndex);
         OnMemberChanged?.Invoke();
     }
 }
コード例 #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();
     }
 }
コード例 #4
0
 private void btnUp_Click()
 {
     if (SelectedIndex > 0)
     {
         int index = SelectedIndex;
         Switch(SelectedIndex, SelectedIndex - 1);
         SelectedIndex = index - 1;
         OnMemberChanged?.Invoke();
     }
 }
コード例 #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();
 }
コード例 #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();
     }
 }
コード例 #7
0
 private void insertItem(object key, object element)
 {
     Collection.Add(new DictionaryElement(StringConv, key, element));
     OnMemberChanged?.Invoke();
 }
コード例 #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();
 }