コード例 #1
0
        public My_Picture Undo()
        {
            int index = history.IndexOf(current);

            if (index > 0)
            {
                current = history.ElementAt <My_Picture>(index - 1);
            }
            return(current.Clone());
        }
コード例 #2
0
        public void add(My_Picture item)
        {
            int index = history.IndexOf(current);

            current = item.Clone();

            if (index == history.Count - 1)
            {
                history.Add(current);
                return;
            }
            history.RemoveRange(index + 1, (history.Count - index - 1));
            history.Add(current);
        }
コード例 #3
0
        public My_Picture ReDo()
        {
            int index = history.IndexOf(current);

            if (index == history.Count - 1)
            {
                current = history.Last <My_Picture>();
            }
            if (index == -1)
            {
                current = history.First <My_Picture>();
            }
            current = history.ElementAt <My_Picture>(index + 1);
            return(current.Clone());
        }