Beispiel #1
0
        public override void Do()
        {
            if (InsertIndex.Equals(-1))
            {
                foreach (var lyric in Items)
                {
                    if (!IsReverseAdd)
                    {
                        TargetList.Add(lyric);
                    }
                    else
                    {
                        TargetList.Insert(0, lyric);
                    }
                }
                return;
            }

            foreach (var lyric in Items)
            {
                if (!IsReverseAdd)
                {
                    TargetList.Insert(InsertIndex + 1, lyric);
                }
                else
                {
                    TargetList.Insert(InsertIndex, lyric);
                }
            }
        }
Beispiel #2
0
        public int CompareTo(object obj)
        {
            if (nameof(obj).Equals(nameof(InsertIndex)))
            {
                return(InsertIndex.CompareTo(obj));
            }

            if (nameof(obj).Equals(nameof(UpdateIndex)))
            {
                return(UpdateIndex.CompareTo(obj));
            }
            else
            {
                return(0);
            }
        }