private void CreateVersion_FormClosing(object sender, FormClosingEventArgs e)
 {
     ReferenceMain.Show();
 }
        private void CreateVersionButton_Click(object sender, EventArgs e)
        {
            string name = VersionNameTextBox.Text;

            if (string.IsNullOrWhiteSpace(name))
            {
                _ = MessageBox.Show("Version Name not specified.", "Warning");
                return;
            }

            string activePath = ActiveModsPathTextBox.Text;

            if (string.IsNullOrWhiteSpace(activePath))
            {
                _ = MessageBox.Show("Active Mods Directory Path not specified.", "Warning");
                return;
            }
            else if (!Directory.Exists(activePath))
            {
                _ = MessageBox.Show("Specified Active Mods Directory does not exist!", "Warning");
                return;
            }

            string storagePath = StorageModsPathTextBox.Text;

            if (string.IsNullOrWhiteSpace(storagePath))
            {
                _ = MessageBox.Show("Storage Mods Directory Path not specified.", "Warning");
                return;
            }
            else if (storagePath == activePath)
            {
                _ = MessageBox.Show("Active and Storage Directories cannot be the same!", "Warning");
                return;
            }
            else if (!Directory.Exists(storagePath))
            {
                _ = MessageBox.Show("Specified Storage Directory does not exist!", "Warning");
                return;
            }

            if (IsEdit)
            {
                Version.Name              = name;
                Version.ActiveFolderPath  = activePath;
                Version.StorageFolderPath = storagePath;

                ReferenceMain.EditVersionInTable(Version);

                logger.LogMessage($"Version {Version.Name}:{Version.Id} edited", LogLevel.Debug);
            }
            else
            {
                ReferenceMain.AddVersion(new MinecraftVersion()
                {
                    Id = Tools.CreateId(), Name = name, ActiveFolderPath = activePath, StorageFolderPath = storagePath
                });
                logger.LogMessage($"Version {name} created", LogLevel.Debug);
            }

            logger.LogMessage($"\tVersion Name: \"{name}\"", LogLevel.Verbose);
            logger.LogMessage($"\tVersion ActiveFolderPath: \"{activePath}\"", LogLevel.Verbose);
            logger.LogMessage($"\tVersion StorageFolderPath: \"{storagePath}\"", LogLevel.Verbose);

            ReferenceMain.Show();
            Close();
        }
 private void PresetsPage_FormClosing(object sender, FormClosingEventArgs e)
 {
     ReferenceMain.Show();
 }