Ejemplo n.º 1
0
        public static void Initialize()
        {
            _versionCollection = new VersionCollection();

            // This version.
            _versionCollection.Add(new Version(ApplicationCodename, ApplicationVersion, isCurrentVersion: true));

            // Older versions should be listed here.
            _versionCollection.Add(new Version(CODENAME_CLARA, "2.1.8.2"));  // Last version that introduced the Macro concept
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.0"));  // Support for unlimited number of screens
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.1"));  // Fixed empty window title bug
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.2"));  // Continue screen capture session when drive not available
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.3"));  // Changes to how we save screenshots
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.4"));  // More changes to how we save screenshots
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.5"));  // Fixes the changes to how we save screenshots
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.6"));  // Can now select an existing label when applying a label
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.7"));  // Fixed upgrade path from old versions. Can now filter by Process Name
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.8"));  // Introduced %user% and %machine% macro tags
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.9"));  // Fixed upgrade path from older versions
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.10")); // Fixed bug with %count% tag value when display is not available
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.11")); // %screen% tag re-introduced
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.12")); // Fixed bug with JPEG quality
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.13")); // Fixed null reference when application starts at startup from Windows Startup folder
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.14")); // Introduced %title% tag
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.15")); // Strip out backslash if it's in the active window title
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.16")); // Stop timerPerformMaintenance when window is open and start it again when window is closed
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.17")); // Passphrase is now hashed
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.18")); // Performance improvement with writing screenshot references to screenshots.xml

            Application          = new SettingCollection();
            Application.Filepath = FileSystem.SettingsFolder + FileSystem.ApplicationSettingsFile;

            User          = new SettingCollection();
            User.Filepath = FileSystem.SettingsFolder + FileSystem.UserSettingsFile;

            // Construct the version manager using the version collection and setting collection (containing the user's settings) we just prepared.
            VersionManager = new VersionManager(_versionCollection, User);

            if (!Directory.Exists(FileSystem.SettingsFolder))
            {
                Directory.CreateDirectory(FileSystem.SettingsFolder);
            }

            if (Application != null)
            {
                if (File.Exists(Application.Filepath))
                {
                    Application.Load();

                    Application.GetByKey("Name", defaultValue: Settings.ApplicationName).Value       = ApplicationName;
                    Application.GetByKey("Version", defaultValue: Settings.ApplicationVersion).Value = ApplicationVersion;

                    Application.Save();
                }
                else
                {
                    Application.Add(new Setting("Name", ApplicationName));
                    Application.Add(new Setting("Version", ApplicationVersion));
                    Application.Add(new Setting("DebugMode", false));

                    Application.Save();
                }
            }

            if (User != null && !File.Exists(User.Filepath))
            {
                User.Add(new Setting("IntScreenCaptureInterval", 60000));
                User.Add(new Setting("IntCaptureLimit", 0));
                User.Add(new Setting("BoolCaptureLimit", false));
                User.Add(new Setting("BoolTakeInitialScreenshot", false));
                User.Add(new Setting("BoolShowSystemTrayIcon", true));
                User.Add(new Setting("BoolCaptureStopAt", false));
                User.Add(new Setting("BoolCaptureStartAt", false));
                User.Add(new Setting("BoolCaptureOnSunday", false));
                User.Add(new Setting("BoolCaptureOnMonday", false));
                User.Add(new Setting("BoolCaptureOnTuesday", false));
                User.Add(new Setting("BoolCaptureOnWednesday", false));
                User.Add(new Setting("BoolCaptureOnThursday", false));
                User.Add(new Setting("BoolCaptureOnFriday", false));
                User.Add(new Setting("BoolCaptureOnSaturday", false));
                User.Add(new Setting("BoolCaptureOnTheseDays", false));
                User.Add(new Setting("DateTimeCaptureStopAtValue", new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0)));
                User.Add(new Setting("DateTimeCaptureStartAtValue", new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 0, 0)));
                User.Add(new Setting("StringPassphrase", string.Empty));
                User.Add(new Setting("IntKeepScreenshotsForDays", 30));
                User.Add(new Setting("StringScreenshotLabel", string.Empty));
                User.Add(new Setting("BoolApplyScreenshotLabel", false));

                User.Save();
            }
        }
Ejemplo n.º 2
0
        public static void Initialize()
        {
            _versionCollection = new VersionCollection();

            // This version.
            _versionCollection.Add(new Version(ApplicationCodename, ApplicationVersion, isCurrentVersion: true));

            // Older versions should be listed here.
            _versionCollection.Add(new Version("Clara", "2.1.8.2"));

            Application          = new SettingCollection();
            Application.Filepath = FileSystem.SettingsFolder + FileSystem.ApplicationSettingsFile;

            User          = new SettingCollection();
            User.Filepath = FileSystem.SettingsFolder + FileSystem.UserSettingsFile;

            // Construct the version manager using the version collection and setting collection (containing the user's settings) we just prepared.
            VersionManager = new VersionManager(_versionCollection, User);

            if (!Directory.Exists(FileSystem.SettingsFolder))
            {
                Directory.CreateDirectory(FileSystem.SettingsFolder);
            }

            if (Application != null)
            {
                if (File.Exists(Application.Filepath))
                {
                    Application.Load();

                    Application.GetByKey("Name", defaultValue: Settings.ApplicationName).Value       = ApplicationName;
                    Application.GetByKey("Version", defaultValue: Settings.ApplicationVersion).Value = ApplicationVersion;

                    Application.Save();
                }
                else
                {
                    Application.Add(new Setting("Name", ApplicationName));
                    Application.Add(new Setting("Version", ApplicationVersion));
                    Application.Add(new Setting("DebugMode", false));

                    Application.Save();
                }
            }

            if (User != null && !File.Exists(User.Filepath))
            {
                User.Add(new Setting("IntScreenCaptureInterval", 60000));
                User.Add(new Setting("IntCaptureLimit", 0));
                User.Add(new Setting("BoolCaptureLimit", false));
                User.Add(new Setting("BoolTakeInitialScreenshot", false));
                User.Add(new Setting("BoolShowSystemTrayIcon", true));
                User.Add(new Setting("BoolCaptureStopAt", false));
                User.Add(new Setting("BoolCaptureStartAt", false));
                User.Add(new Setting("BoolCaptureOnSunday", false));
                User.Add(new Setting("BoolCaptureOnMonday", false));
                User.Add(new Setting("BoolCaptureOnTuesday", false));
                User.Add(new Setting("BoolCaptureOnWednesday", false));
                User.Add(new Setting("BoolCaptureOnThursday", false));
                User.Add(new Setting("BoolCaptureOnFriday", false));
                User.Add(new Setting("BoolCaptureOnSaturday", false));
                User.Add(new Setting("BoolCaptureOnTheseDays", false));
                User.Add(new Setting("DateTimeCaptureStopAtValue", new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0)));
                User.Add(new Setting("DateTimeCaptureStartAtValue", new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 0, 0)));
                User.Add(new Setting("BoolLockScreenCaptureSession", false));
                User.Add(new Setting("StringPassphrase", string.Empty));
                User.Add(new Setting("IntKeepScreenshotsForDays", 30));

                User.Save();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        public static void Initialize()
        {
            _versionCollection = new VersionCollection();

            // This version.
            _versionCollection.Add(new Version(ApplicationCodename, ApplicationVersion, isCurrentVersion: true));

            // Older versions should be listed here.
            // WARNING: Never have any of the individual numbers go beyond 9 unless you want to break the upgrade system! This was an issue introduced in 2.2.0.10.
            _versionCollection.Add(new Version(CODENAME_CLARA, "2.1.8.2"));  // "Clara"; the last version in the 2.1 "macro" series. This includes the large user.xml file fix (2.1.7.9), "the handle is invalid" fix when Windows is locked (2.1.8.0), and the removal of the "start when Windows starts" feature (2.1.8.1); because anti-virus software falsely flags the application as a virus if we do that.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.0"));  // "Dalek"; support for unlimited number of screens. This was a huge release with the most commits ever in the application's history.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.1"));  // Fixed bug with empty window title which resulted in image files remaining after cleanup.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.2"));  // Application no longer stops current screen capture session if the directory root does not exist or the drive is not ready. This ensures that the current screen capture session will continue even if the drive being referenced is not available for some reason. Useful if you usually save screen images to an external drive but then disconnect from it and want to continue using the laptop's internal drive. Reintroduced the thread for saving screenshots and the lock on xDoc
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.3"));  // Active window title is retrieved earlier for less chance in having different titles in different screenshot objects despite being in the same screen capture cycle. Some code cleanup. Documentation being added. Fixed a racing condition issue with KeepScreenshotsForDays and Save in ScreenshotCollection
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.4"));  // Expanded scope of lock around screenshot list
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.5"));  // Old screenshots are deleted and unsaved screenshots are saved within the same timer
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.6"));  // An existing label can now be selected from a drop down list of available labels and applying a label to each screenshot is now determined by a checkbox value
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.7"));  // Process Name introduced. Can now filter by an application's process name. Fixed upgrade path from old versions. Removed -debug command line argument. ScreenCapture Count is now reduced whenever there is no image available to capture or active window title is empty to hopefully make the count more accurate when using the count tag. Logging removed in TakeScreenshot and ScreenCapture Save methods to save on disk space when DebugMode enabled
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.8"));  // New macro tags for getting the name of the currently logged in user and the name of the machine being used
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.9"));  // Fixed upgrade path from older versions
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.10")); // Fixed bug with count value when display is not available
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.11")); // The %screen% tag has been re-introduced to represent the screen number. Fixed bug with taskbar not being captured. Fixed bug with JPEG quality and resolution ratio
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.12")); // Fixed bug with JPEG quality
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.13")); // Fixed null reference error when multiple application instances are started.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.14")); // Introduced a new tag that gets the title of the active window. Also added a new method method in MacroParser that strips away characters that are invalid in Windows filenames (except for the backslash character since we use that for the directory path).
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.15")); // Strip out backslash if it's in the active window title.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.16")); // Maintenance timer is turned on when interface is hidden and turned on when interface is shown.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.17")); // Replaced -lock command line argument with -passphrase and added logic around hashing the passphrase given from the command line.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.18")); // Performance improvements when saving screenshot references to screenshots.xml file.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.19")); // Fixing system tray icon messages when mouse hovers over icon during maintenance. Also attempting to fix bug with collection being modified when browsing screenshots.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.20")); // Tab pages now auto-scroll.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.21")); // Configure drop down menu finished.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.0.22")); // Fixed scheduled start time when running from command line.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.1.0"));  // Logging is now an application setting and DebugMode has become verbose logging. I've also fixed a few issues when running -config from the command line.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.1.1"));  // You can now add Batch Scripts, PowerShell Scripts, and any type of file for an Editor. Also removed the "Show system tray icon" option.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.1.2"));  // Fixed a bug with saving passphrase and hiding system tray icon during command line execution.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.0"));  // Completed work on Email Screenshot. Also included EmailScreenshot action for Triggers and added confirmation dialog boxes when emailing a screenshot from the interface and removing a screen or region. Email icon image added to Email button.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.1"));  // Fixed a few bugs.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.2"));  // Fixed bug with passphrase hash that was being hashed through old version detection by accident.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.3"));  // Moved default location of autoscreen.conf file.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.4"));  // Macro tags %machine% and %user% can now be used in folder paths and all paths of the autoscreen.conf file.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.5"));  // Fixed bug with upgrade system.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.6"));  // Fixed upgrade system. For real this time.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.7"));  // Make sure we do not check the drive information if the path is a shared network path.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.8"));  // Fixed an issue with displaying a screenshot preview.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.2.9"));  // Double click system tray icon to show or hide interface. Fixed issue with having backslash characters in name and any invalid Windows characters in path.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.3.0"));  // Apply Label system tray icon menu lists available labels.
            _versionCollection.Add(new Version(CODENAME_DALEK, "2.2.3.1"));  // Apply Label is made invisible when screen capture session is locked. Fixed bug with parsing command line arguments.

            Application = new SettingCollection
            {
                Filepath = FileSystem.ApplicationSettingsFile
            };

            User = new SettingCollection
            {
                Filepath = FileSystem.UserSettingsFile
            };

            // Construct the version manager using the version collection and setting collection (containing the user's settings) we just prepared.
            VersionManager = new VersionManager(_versionCollection, User);

            if (Application != null && !string.IsNullOrEmpty(Application.Filepath))
            {
                if (File.Exists(Application.Filepath))
                {
                    Application.Load();

                    Application.GetByKey("Name", defaultValue: Settings.ApplicationName).Value       = ApplicationName;
                    Application.GetByKey("Version", defaultValue: Settings.ApplicationVersion).Value = ApplicationVersion;

                    if (!Application.KeyExists("DebugMode"))
                    {
                        Application.Add(new Setting("DebugMode", false));
                    }

                    if (!Application.KeyExists("ExitOnError"))
                    {
                        Application.Add(new Setting("ExitOnError", false));
                    }

                    if (!Application.KeyExists("Logging"))
                    {
                        Application.Add(new Setting("Logging", false));
                    }

                    if (!Application.KeyExists("EmailServerHost"))
                    {
                        Application.Add(new Setting("EmailServerHost", string.Empty));
                    }

                    if (!Application.KeyExists("EmailServerPort"))
                    {
                        Application.Add(new Setting("EmailServerPort", 587));
                    }

                    if (!Application.KeyExists("EmailServerEnableSSL"))
                    {
                        Application.Add(new Setting("EmailServerEnableSSL", true));
                    }

                    if (!Application.KeyExists("EmailClientUsername"))
                    {
                        Application.Add(new Setting("EmailClientUsername", string.Empty));
                    }

                    if (!Application.KeyExists("EmailClientPassword"))
                    {
                        Application.Add(new Setting("EmailClientPassword", string.Empty));
                    }

                    if (!Application.KeyExists("EmailMessageFrom"))
                    {
                        Application.Add(new Setting("EmailMessageFrom", string.Empty));
                    }

                    if (!Application.KeyExists("EmailMessageTo"))
                    {
                        Application.Add(new Setting("EmailMessageTo", string.Empty));
                    }

                    if (!Application.KeyExists("EmailMessageCC"))
                    {
                        Application.Add(new Setting("EmailMessageCC", string.Empty));
                    }

                    if (!Application.KeyExists("EmailMessageBCC"))
                    {
                        Application.Add(new Setting("EmailMessageBCC", string.Empty));
                    }

                    if (!Application.KeyExists("EmailMessageSubject"))
                    {
                        Application.Add(new Setting("EmailMessageSubject", string.Empty));
                    }

                    if (!Application.KeyExists("EmailMessageBody"))
                    {
                        Application.Add(new Setting("EmailMessageBody", string.Empty));
                    }
                }
                else
                {
                    Application.Add(new Setting("Name", ApplicationName));
                    Application.Add(new Setting("Version", ApplicationVersion));
                    Application.Add(new Setting("DebugMode", false));
                    Application.Add(new Setting("Logging", false));
                    Application.Add(new Setting("EmailServerHost", string.Empty));
                    Application.Add(new Setting("EmailServerPort", 587));
                    Application.Add(new Setting("EmailServerEnableSSL", true));
                    Application.Add(new Setting("EmailClientUsername", string.Empty));
                    Application.Add(new Setting("EmailClientPassword", string.Empty));
                    Application.Add(new Setting("EmailMessageFrom", string.Empty));
                    Application.Add(new Setting("EmailMessageTo", string.Empty));
                    Application.Add(new Setting("EmailMessageCC", string.Empty));
                    Application.Add(new Setting("EmailMessageBCC", string.Empty));
                    Application.Add(new Setting("EmailMessageSubject", string.Empty));
                    Application.Add(new Setting("EmailMessageBody", string.Empty));
                }

                Application.Save();
            }

            if (User != null && !string.IsNullOrEmpty(User.Filepath) && !File.Exists(User.Filepath))
            {
                User.Add(new Setting("IntScreenCaptureInterval", 60000));
                User.Add(new Setting("IntCaptureLimit", 0));
                User.Add(new Setting("BoolCaptureLimit", false));
                User.Add(new Setting("BoolTakeInitialScreenshot", false));
                User.Add(new Setting("BoolShowSystemTrayIcon", true));
                User.Add(new Setting("BoolCaptureStopAt", false));
                User.Add(new Setting("BoolCaptureStartAt", false));
                User.Add(new Setting("BoolCaptureOnSunday", false));
                User.Add(new Setting("BoolCaptureOnMonday", false));
                User.Add(new Setting("BoolCaptureOnTuesday", false));
                User.Add(new Setting("BoolCaptureOnWednesday", false));
                User.Add(new Setting("BoolCaptureOnThursday", false));
                User.Add(new Setting("BoolCaptureOnFriday", false));
                User.Add(new Setting("BoolCaptureOnSaturday", false));
                User.Add(new Setting("BoolCaptureOnTheseDays", false));
                User.Add(new Setting("DateTimeCaptureStopAtValue", new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 0, 0)));
                User.Add(new Setting("DateTimeCaptureStartAtValue", new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 0, 0)));
                User.Add(new Setting("StringPassphrase", string.Empty));
                User.Add(new Setting("IntKeepScreenshotsForDays", 30));
                User.Add(new Setting("StringScreenshotLabel", string.Empty));
                User.Add(new Setting("BoolApplyScreenshotLabel", false));

                User.Save();
            }

            Log.DebugMode = Convert.ToBoolean(Application.GetByKey("DebugMode", defaultValue: false).Value);
            Log.Enabled   = Convert.ToBoolean(Application.GetByKey("Logging", defaultValue: false).Value);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new version collection and populates it with all the various versions of the application.
        /// </summary>
        public static void Initialize()
        {
            _versionCollection = new VersionCollection
            {
                // This version.
                new Version(ApplicationCodename, ApplicationVersion, isCurrentVersion: true),

                // Older versions should be listed here.
                // WARNING: Never have any of the individual numbers go beyond 9 unless you want to break the upgrade system! This was an issue introduced in 2.2.0.10.
                new Version(CODENAME_CLARA, "2.1.8.2"),     // "Clara"; the last version in the 2.1 "macro" series. This includes the large user.xml file fix (2.1.7.9), "the handle is invalid" fix when Windows is locked (2.1.8.0), and the removal of the "start when Windows starts" feature (2.1.8.1); because anti-virus software falsely flags the application as a virus if we do that.
                new Version(CODENAME_DALEK, "2.2.0.0"),     // "Dalek"; support for unlimited number of screens. This was a huge release with the most commits ever in the application's history.
                new Version(CODENAME_DALEK, "2.2.0.1"),     // Fixed bug with empty window title which resulted in image files remaining after cleanup.
                new Version(CODENAME_DALEK, "2.2.0.2"),     // Application no longer stops current screen capture session if the directory root does not exist or the drive is not ready. This ensures that the current screen capture session will continue even if the drive being referenced is not available for some reason. Useful if you usually save screen images to an external drive but then disconnect from it and want to continue using the laptop's internal drive. Reintroduced the thread for saving screenshots and the lock on xDoc
                new Version(CODENAME_DALEK, "2.2.0.3"),     // Active window title is retrieved earlier for less chance in having different titles in different screenshot objects despite being in the same screen capture cycle. Some code cleanup. Documentation being added. Fixed a racing condition issue with KeepScreenshotsForDays and Save in ScreenshotCollection
                new Version(CODENAME_DALEK, "2.2.0.4"),     // Expanded scope of lock around screenshot list
                new Version(CODENAME_DALEK, "2.2.0.5"),     // Old screenshots are deleted and unsaved screenshots are saved within the same timer
                new Version(CODENAME_DALEK, "2.2.0.6"),     // An existing label can now be selected from a drop down list of available labels and applying a label to each screenshot is now determined by a checkbox value
                new Version(CODENAME_DALEK, "2.2.0.7"),     // Process Name introduced. Can now filter by an application's process name. Fixed upgrade path from old versions. Removed -debug command line argument. ScreenCapture Count is now reduced whenever there is no image available to capture or active window title is empty to hopefully make the count more accurate when using the count tag. Logging removed in TakeScreenshot and ScreenCapture Save methods to save on disk space when DebugMode enabled
                new Version(CODENAME_DALEK, "2.2.0.8"),     // New macro tags for getting the name of the currently logged in user and the name of the machine being used
                new Version(CODENAME_DALEK, "2.2.0.9"),     // Fixed upgrade path from older versions
                new Version(CODENAME_DALEK, "2.2.0.10"),    // Fixed bug with count value when display is not available
                new Version(CODENAME_DALEK, "2.2.0.11"),    // The %screen% tag has been re-introduced to represent the screen number. Fixed bug with taskbar not being captured. Fixed bug with JPEG quality and resolution ratio
                new Version(CODENAME_DALEK, "2.2.0.12"),    // Fixed bug with JPEG quality
                new Version(CODENAME_DALEK, "2.2.0.13"),    // Fixed null reference error when multiple application instances are started.
                new Version(CODENAME_DALEK, "2.2.0.14"),    // Introduced a new tag that gets the title of the active window. Also added a new method method in MacroParser that strips away characters that are invalid in Windows filenames (except for the backslash character since we use that for the directory path).
                new Version(CODENAME_DALEK, "2.2.0.15"),    // Strip out backslash if it's in the active window title.
                new Version(CODENAME_DALEK, "2.2.0.16"),    // Maintenance timer is turned on when interface is hidden and turned on when interface is shown.
                new Version(CODENAME_DALEK, "2.2.0.17"),    // Replaced -lock command line argument with -passphrase and added logic around hashing the passphrase given from the command line.
                new Version(CODENAME_DALEK, "2.2.0.18"),    // Performance improvements when saving screenshot references to screenshots.xml file.
                new Version(CODENAME_DALEK, "2.2.0.19"),    // Fixing system tray icon messages when mouse hovers over icon during maintenance. Also attempting to fix bug with collection being modified when browsing screenshots.
                new Version(CODENAME_DALEK, "2.2.0.20"),    // Tab pages now auto-scroll.
                new Version(CODENAME_DALEK, "2.2.0.21"),    // Configure drop down menu finished.
                new Version(CODENAME_DALEK, "2.2.0.22"),    // Fixed scheduled start time when running from command line.
                new Version(CODENAME_DALEK, "2.2.1.0"),     // Logging is now an application setting and DebugMode has become verbose logging. I've also fixed a few issues when running -config from the command line.
                new Version(CODENAME_DALEK, "2.2.1.1"),     // You can now add Batch Scripts, PowerShell Scripts, and any type of file for an Editor. Also removed the "Show system tray icon" option.
                new Version(CODENAME_DALEK, "2.2.1.2"),     // Fixed a bug with saving passphrase and hiding system tray icon during command line execution.
                new Version(CODENAME_DALEK, "2.2.2.0"),     // Completed work on Email Screenshot. Also included EmailScreenshot action for Triggers and added confirmation dialog boxes when emailing a screenshot from the interface and removing a screen or region. Email icon image added to Email button.
                new Version(CODENAME_DALEK, "2.2.2.1"),     // Fixed a few bugs.
                new Version(CODENAME_DALEK, "2.2.2.2"),     // Fixed bug with passphrase hash that was being hashed through old version detection by accident.
                new Version(CODENAME_DALEK, "2.2.2.3"),     // Moved default location of autoscreen.conf file.
                new Version(CODENAME_DALEK, "2.2.2.4"),     // Macro tags %machine% and %user% can now be used in folder paths and all paths of the autoscreen.conf file.
                new Version(CODENAME_DALEK, "2.2.2.5"),     // Fixed bug with upgrade system.
                new Version(CODENAME_DALEK, "2.2.2.6"),     // Fixed upgrade system. For real this time.
                new Version(CODENAME_DALEK, "2.2.2.7"),     // Make sure we do not check the drive information if the path is a shared network path.
                new Version(CODENAME_DALEK, "2.2.2.8"),     // Fixed an issue with displaying a screenshot preview.
                new Version(CODENAME_DALEK, "2.2.2.9"),     // Double click system tray icon to show or hide interface. Fixed issue with having backslash characters in name and any invalid Windows characters in path.
                new Version(CODENAME_DALEK, "2.2.3.0"),     // Apply Label system tray icon menu lists available labels.
                new Version(CODENAME_DALEK, "2.2.3.1"),     // Apply Label is made invisible when screen capture session is locked. Fixed bug with parsing command line arguments.
                new Version(CODENAME_DALEK, "2.2.3.2"),     // Apply Label fixed to show labels whenever the system tray icon menu is opened.
                new Version(CODENAME_DALEK, "2.2.4.6"),     // System tray icon turns green when screen capture session is running. Tags are now user-defined and have their own module.
                new Version(CODENAME_DALEK, "2.2.5.0"),     // A version that was never released. This was to make startup speed faster but major features implemented for the application (such as Schedules and controlling a running instance of the application from the command line) deserved 2.2.5.0 to become 2.3.0.0! Boombayah!
                new Version(CODENAME_BOOMBAYAH, "2.3.0.0"), // Faster startup, commands can be issued to a running instance, multiple schedules, more trigger conditions and trigger actions, and help tips in the help bar.
                new Version(CODENAME_BOOMBAYAH, "2.3.0.1"), // Fixed bug with FilenameLengthLimit application setting.
                new Version(CODENAME_BOOMBAYAH, "2.3.0.2"), // Keyboard Shortcuts implemented.
                new Version(CODENAME_BOOMBAYAH, "2.3.0.3")  // Fixed bug when creating a new Trigger.
            };

            Application = new SettingCollection
            {
                Filepath = FileSystem.ApplicationSettingsFile
            };

            User = new SettingCollection
            {
                Filepath = FileSystem.UserSettingsFile
            };

            // Construct the version manager using the version collection and setting collection (containing the user's settings) we just prepared.
            VersionManager = new VersionManager(_versionCollection, User);

            if (Application != null && !string.IsNullOrEmpty(Application.Filepath))
            {
                if (FileSystem.FileExists(Application.Filepath))
                {
                    Application.Load();

                    Application.GetByKey("Name", DefaultSettings.ApplicationName).Value       = ApplicationName;
                    Application.GetByKey("Version", DefaultSettings.ApplicationVersion).Value = ApplicationVersion;

                    if (!Application.KeyExists("DebugMode"))
                    {
                        Application.Add(new Setting("DebugMode", DefaultSettings.DebugMode));
                    }

                    if (!Application.KeyExists("ExitOnError"))
                    {
                        Application.Add(new Setting("ExitOnError", DefaultSettings.ExitOnError));
                    }

                    if (!Application.KeyExists("Logging"))
                    {
                        Application.Add(new Setting("Logging", DefaultSettings.Logging));
                    }

                    if (!Application.KeyExists("EmailServerHost"))
                    {
                        Application.Add(new Setting("EmailServerHost", DefaultSettings.EmailServerHost));
                    }

                    if (!Application.KeyExists("EmailServerPort"))
                    {
                        Application.Add(new Setting("EmailServerPort", DefaultSettings.EmailServerPort));
                    }

                    if (!Application.KeyExists("EmailServerEnableSSL"))
                    {
                        Application.Add(new Setting("EmailServerEnableSSL", DefaultSettings.EmailServerEnableSSL));
                    }

                    if (!Application.KeyExists("EmailClientUsername"))
                    {
                        Application.Add(new Setting("EmailClientUsername", DefaultSettings.EmailClientUsername));
                    }

                    if (!Application.KeyExists("EmailClientPassword"))
                    {
                        Application.Add(new Setting("EmailClientPassword", DefaultSettings.EmailClientPassword));
                    }

                    if (!Application.KeyExists("EmailMessageFrom"))
                    {
                        Application.Add(new Setting("EmailMessageFrom", DefaultSettings.EmailMessageFrom));
                    }

                    if (!Application.KeyExists("EmailMessageTo"))
                    {
                        Application.Add(new Setting("EmailMessageTo", DefaultSettings.EmailMessageTo));
                    }

                    if (!Application.KeyExists("EmailMessageCC"))
                    {
                        Application.Add(new Setting("EmailMessageCC", DefaultSettings.EmailMessageCC));
                    }

                    if (!Application.KeyExists("EmailMessageBCC"))
                    {
                        Application.Add(new Setting("EmailMessageBCC", DefaultSettings.EmailMessageBCC));
                    }

                    if (!Application.KeyExists("EmailMessageSubject"))
                    {
                        Application.Add(new Setting("EmailMessageSubject", DefaultSettings.EmailMessageSubject));
                    }

                    if (!Application.KeyExists("EmailMessageBody"))
                    {
                        Application.Add(new Setting("EmailMessageBody", DefaultSettings.EmailMessageBody));
                    }

                    if (!Application.KeyExists("EmailPrompt"))
                    {
                        Application.Add(new Setting("EmailPrompt", DefaultSettings.EmailPrompt));
                    }

                    if (!Application.KeyExists("LowDiskPercentageThreshold"))
                    {
                        Application.Add(new Setting("LowDiskPercentageThreshold", DefaultSettings.LowDiskPercentageThreshold));
                    }

                    if (!Application.KeyExists("ScreenshotsLoadLimit"))
                    {
                        Application.Add(new Setting("ScreenshotsLoadLimit", DefaultSettings.ScreenshotsLoadLimit));
                    }

                    if (!Application.KeyExists("AutoStartFromCommandLine"))
                    {
                        Application.Add(new Setting("AutoStartFromCommandLine", DefaultSettings.AutoStartFromCommandLine));

                        // If this is a version before 2.3.0.0 then set this setting to true because
                        // starting a screen capture session was the old behaviour when running autoscreen.exe
                        // from the command line.
                        if (VersionManager.IsOldAppVersion(Application.AppCodename, Application.AppVersion))
                        {
                            Version v2300         = VersionManager.Versions.Get(CODENAME_BOOMBAYAH, "2.3.0.0");
                            Version configVersion = VersionManager.Versions.Get(Application.AppCodename, Application.AppVersion);

                            if (v2300 != null && configVersion != null && configVersion.VersionNumber < v2300.VersionNumber)
                            {
                                Application.GetByKey("AutoStartFromCommandLine", DefaultSettings.AutoStartFromCommandLine).Value = true;
                            }
                        }
                    }

                    if (!Application.KeyExists("ShowStartupError"))
                    {
                        Application.Add(new Setting("ShowStartupError", DefaultSettings.ShowStartupError));
                    }

                    if (!Application.KeyExists("FilepathLengthLimit"))
                    {
                        Application.Add(new Setting("FilepathLengthLimit", DefaultSettings.FilepathLengthLimit));
                    }

                    if (!Application.KeyExists("StopOnLowDiskError"))
                    {
                        Application.Add(new Setting("StopOnLowDiskError", DefaultSettings.StopOnLowDiskError));
                    }
                }
                else
                {
                    Application.Add(new Setting("Name", ApplicationName));
                    Application.Add(new Setting("Version", ApplicationVersion));
                    Application.Add(new Setting("DebugMode", DefaultSettings.DebugMode));
                    Application.Add(new Setting("ExitOnError", DefaultSettings.ExitOnError));
                    Application.Add(new Setting("Logging", DefaultSettings.Logging));
                    Application.Add(new Setting("EmailServerHost", DefaultSettings.EmailServerHost));
                    Application.Add(new Setting("EmailServerPort", DefaultSettings.EmailServerPort));
                    Application.Add(new Setting("EmailServerEnableSSL", DefaultSettings.EmailServerEnableSSL));
                    Application.Add(new Setting("EmailClientUsername", DefaultSettings.EmailClientUsername));
                    Application.Add(new Setting("EmailClientPassword", DefaultSettings.EmailClientPassword));
                    Application.Add(new Setting("EmailMessageFrom", DefaultSettings.EmailMessageFrom));
                    Application.Add(new Setting("EmailMessageTo", DefaultSettings.EmailMessageTo));
                    Application.Add(new Setting("EmailMessageCC", DefaultSettings.EmailMessageCC));
                    Application.Add(new Setting("EmailMessageBCC", DefaultSettings.EmailMessageBCC));
                    Application.Add(new Setting("EmailMessageSubject", DefaultSettings.EmailMessageSubject));
                    Application.Add(new Setting("EmailMessageBody", DefaultSettings.EmailMessageBody));
                    Application.Add(new Setting("EmailPrompt", DefaultSettings.EmailPrompt));
                    Application.Add(new Setting("LowDiskPercentageThreshold", DefaultSettings.LowDiskPercentageThreshold));
                    Application.Add(new Setting("ScreenshotsLoadLimit", DefaultSettings.ScreenshotsLoadLimit));
                    Application.Add(new Setting("AutoStartFromCommandLine", DefaultSettings.AutoStartFromCommandLine));
                    Application.Add(new Setting("ShowStartupError", DefaultSettings.ShowStartupError));
                    Application.Add(new Setting("FilepathLengthLimit", DefaultSettings.FilepathLengthLimit));
                    Application.Add(new Setting("StopOnLowDiskError", DefaultSettings.StopOnLowDiskError));
                }

                Application.Save();
            }

            if (User != null && !string.IsNullOrEmpty(User.Filepath) && !FileSystem.FileExists(User.Filepath))
            {
                User.Add(new Setting("IntScreenCaptureInterval", DefaultSettings.IntScreenCaptureInterval));
                User.Add(new Setting("IntCaptureLimit", DefaultSettings.IntCaptureLimit));
                User.Add(new Setting("BoolCaptureLimit", DefaultSettings.BoolCaptureLimit));
                User.Add(new Setting("BoolTakeInitialScreenshot", DefaultSettings.BoolTakeInitialScreenshot));
                User.Add(new Setting("BoolShowSystemTrayIcon", DefaultSettings.BoolShowSystemTrayIcon));
                User.Add(new Setting("StringPassphrase", DefaultSettings.StringPassphrase));
                User.Add(new Setting("IntKeepScreenshotsForDays", DefaultSettings.IntKeepScreenshotsForDays));
                User.Add(new Setting("StringScreenshotLabel", DefaultSettings.StringScreenshotLabel));
                User.Add(new Setting("BoolApplyScreenshotLabel", DefaultSettings.BoolApplyScreenshotLabel));
                User.Add(new Setting("StringDefaultEditor", DefaultSettings.StringDefaultEditor));
                User.Add(new Setting("BoolFirstRun", DefaultSettings.BoolFirstRun));
                User.Add(new Setting("IntStartScreenCaptureCount", DefaultSettings.IntStartScreenCaptureCount));
                User.Add(new Setting("BoolActiveWindowTitleCaptureCheck", DefaultSettings.BoolActiveWindowTitleCaptureCheck));
                User.Add(new Setting("StringActiveWindowTitleCaptureText", DefaultSettings.StringActiveWindowTitleCaptureText));
                User.Add(new Setting("BoolUseKeyboardShortcuts", DefaultSettings.BoolUseKeyboardShortcuts));
                User.Add(new Setting("StringKeyboardShortcutStartScreenCaptureModifier1", DefaultSettings.StringKeyboardShortcutStartScreenCaptureModifier1));
                User.Add(new Setting("StringKeyboardShortcutStartScreenCaptureModifier2", DefaultSettings.StringKeyboardShortcutStartScreenCaptureModifier2));
                User.Add(new Setting("StringKeyboardShortcutStartScreenCaptureKey", DefaultSettings.StringKeyboardShortcutStartScreenCaptureKey));
                User.Add(new Setting("StringKeyboardShortcutStopScreenCaptureModifier1", DefaultSettings.StringKeyboardShortcutStopScreenCaptureModifier1));
                User.Add(new Setting("StringKeyboardShortcutStopScreenCaptureModifier2", DefaultSettings.StringKeyboardShortcutStopScreenCaptureModifier2));
                User.Add(new Setting("StringKeyboardShortcutStopScreenCaptureKey", DefaultSettings.StringKeyboardShortcutStopScreenCaptureKey));
                User.Add(new Setting("StringKeyboardShortcutCaptureNowArchiveModifier1", DefaultSettings.StringKeyboardShortcutCaptureNowArchiveModifier1));
                User.Add(new Setting("StringKeyboardShortcutCaptureNowArchiveModifier2", DefaultSettings.StringKeyboardShortcutCaptureNowArchiveModifier2));
                User.Add(new Setting("StringKeyboardShortcutCaptureNowArchiveKey", DefaultSettings.StringKeyboardShortcutCaptureNowArchiveKey));
                User.Add(new Setting("StringKeyboardShortcutCaptureNowEditModifier1", DefaultSettings.StringKeyboardShortcutCaptureNowEditModifier1));
                User.Add(new Setting("StringKeyboardShortcutCaptureNowEditModifier2", DefaultSettings.StringKeyboardShortcutCaptureNowEditModifier2));
                User.Add(new Setting("StringKeyboardShortcutCaptureNowEditKey", DefaultSettings.StringKeyboardShortcutCaptureNowEditKey));
                User.Add(new Setting("StringKeyboardShortcutRegionSelectClipboardModifier1", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardModifier1));
                User.Add(new Setting("StringKeyboardShortcutRegionSelectClipboardModifier2", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardModifier2));
                User.Add(new Setting("StringKeyboardShortcutRegionSelectClipboardKey", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardKey));

                User.Save();
            }

            Log.DebugMode      = Convert.ToBoolean(Application.GetByKey("DebugMode", DefaultSettings.DebugMode).Value);
            Log.LoggingEnabled = Convert.ToBoolean(Application.GetByKey("Logging", DefaultSettings.Logging).Value);
        }