ScreenToGif/Util/ActionStack.cs

(开头部分) 34KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ScreenToGif.Util.Model;

namespace ScreenToGif.Util
{
    /// <summary>
    /// Do, Undo, Redo stack.
    /// </summary>
    public static class ActionStack
    {
        #region Variables

        public static ProjectInfo Project { get; set; }

        private static readonly Stack<StateChange> UndoStack = new Stack<StateChange>();
        private static readonly Stack<StateChange> RedoStack = new Stack<StateChange>();

        #endregion

        public enum EditAction
        {
            Remove,
            ImageAndProperties,
            Properties,
            Add,
            Reorder,
            RemoveAndAlter,
            AddAndAlter,
        }

        public class StateChange
        {
            public EditAction Cause { get; set; }
            public List<FrameInfo> Frames { get; set; }
            public string CurrentFolder { get; set; }

            public List<int> Indexes { get; set; }
            public List<int> Indexes2 { get; set; }

            /// <summary>
            /// Signals that this state should not be available.
            /// </summary>
            public bool IgnoreWhenReset { get; set; }
        }

        #region Save State

        public static void SaveState(EditAction action, List<FrameInfo> frames, List<int> positions)
        {
            var orderedPositions = positions.OrderBy(x => x).ToList();
            var savedFrames = new List<FrameInfo>();
            var currentFolder = CreateCurrent(true);

            switch (action)
            {
                case EditAction.Remove:

后面还有 935 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。