private void Switch(int a, int b) { SpawnListElement obj = Collection[a]; Collection[a] = Collection[b]; Collection[b] = obj; }
public void gridCollection_DoubleClick(object sender, RoutedEventArgs e) { //int index = lbxCollection.IndexFromPoint(e.X, e.Y); int index = CurrentElement; if (index > -1) { SpawnListElement element = Collection[index]; OnEditItem?.Invoke(index, element.Value, editItem); } }
private void editItem(int index, object element) { index = Math.Min(Math.Max(0, index), Collection.Count); Collection[index] = new SpawnListElement(StringConv, Collection[index].Weight, Collection[index].Chance, element); }