コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }