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