コード例 #1
0
        public Engine(EngineScript engineScript, string snapshotsFolder)
        {
            if (snapshotsFolder != null)
            {
                SnapshotsFolder = snapshotsFolder;
                if (!Directory.Exists(SnapshotsFolder))
                {
                    Directory.CreateDirectory(SnapshotsFolder);
                }

                Logger.Information("snapshotsFolder: ", SnapshotsFolder);
            }

            ScreenshotHelper = new ScreenshotHelper(this);

            Name        = engineScript.Name;
            Title       = engineScript.Title;
            Description = engineScript.Description;

            // Default, mandatory columns
            SnapshotColumnsDefinition.Add(new EngineSnapshotColumnDefinition
            {
                Key        = "SavedAt",
                HeaderText = "Saved At",
                Order      = 0, // first column
            });

            SnapshotColumnsDefinition.Add(new EngineSnapshotColumnDefinition
            {
                Key        = "Notes",
                HeaderText = "Notes",
                Order      = 999, // last column
            });
        }
コード例 #2
0
        public bool AddSnapshotColumnDefinition(EngineSnapshotColumnDefinition columnDefinition)
        {
            EngineSnapshotColumnDefinition found =
                SnapshotColumnsDefinition.FirstOrDefault(c => c.Key == columnDefinition.Key);

            if (found != null)
            {
                return(false);
            }

            SnapshotColumnsDefinition.Add(columnDefinition);
            columnDefinition.Order = SnapshotColumnsDefinition.Count - 1;
            return(true);
        }
コード例 #3
0
        public void Release()
        {
            OnActionSnapshotBackup  = null;
            OnActionSnapshotRestore = null;

            OnClosing     = null;
            OnInitialized = null;
            OnLoaded      = null;
            OnOpened      = null;
            OnClosed      = null;

            SnapshotsFolder = null;
            LastSnapshot    = null;

            Watcher = null;

            foreach (var category in Categories)
            {
                category.OnEquals   = null;
                category.OnToString = null;
            }

            Categories.Clear();

            foreach (var snapshot in Snapshots)
            {
                foreach (var pair in snapshot.CustomValues)
                {
                    pair.Value.OnToString = null;
                }

                snapshot.OnEquals = null;
            }

            Snapshots.Clear();

            SnapshotColumnsDefinition.Clear();

            ProcessNames.Clear();
        }