private void InsertSeparatorMenuItem_Click(object sender, EventArgs e) { var indexes = SelectedIndices.ToList(); if (indexes.Any()) { _watches.Insert(indexes[0], SeparatorWatch.Instance); } else { _watches.Add(SeparatorWatch.Instance); } WatchListView.ItemCount = _watches.Count; Changes(); UpdateWatchCount(); }
private void MoveItemUp(object obj) { ProductMasterItem item = obj as ProductMasterItem; if (item == null) { return; } int curIndex = WatchList.IndexOf(item); if (curIndex > 0) // if not first and found { WatchList.RemoveAt(curIndex); WatchList.Insert(curIndex - 1, item); ExtendedSchedule.Instance.Update(); } }
private void MoveItemDown(object obj) { ProductMasterItem item = obj as ProductMasterItem; if (item == null) { return; } int curIndex = WatchList.IndexOf(item); if (curIndex >= 0 && curIndex != WatchList.Count - 1) // if not last and found { WatchList.RemoveAt(curIndex); WatchList.Insert(curIndex + 1, item); ExtendedSchedule.Instance.Update(); } }