private static AIRVersionData LastResortVersionMethod(string destination, bool isAdding)
            {
                if (isAdding)
                {
                    string       exceptionVersion = "";
                    DialogResult result;
                    result = ExtraDialog.ShowInputDialog(ref exceptionVersion, "", Management.UserLanguage.GetOutputString("VersionSelectCaption1"));
                    while (Directory.Exists($"{exceptionVersion}") && !Uri.IsWellFormedUriString($"{exceptionVersion}", UriKind.Absolute) && (result != System.Windows.Forms.DialogResult.Cancel || result != System.Windows.Forms.DialogResult.Abort))
                    {
                        result = ExtraDialog.ShowInputDialog(ref exceptionVersion, "", Management.UserLanguage.GetOutputString("VersionSelectCaption2"));
                    }

                    AIRVersionData data;
                    data = new AIRVersionData(null, exceptionVersion, null);
                    DataRefrence.Add(destination, data);
                    return(data);
                }
                else
                {
                    if (destination == null || destination == "" || !Directory.Exists(destination))
                    {
                        destination = "NULL";
                    }
                    var data = AIRVersionData.NullableDefault();
                    if (!DataRefrence.ContainsKey(destination))
                    {
                        DataRefrence.Add(destination, data);
                    }
                    return(data);
                }
            }
Exemple #2
0
        public static void SaveModCollecton()
        {
            string name    = Management.UserLanguage.GetOutputString("ModCollectionDialog_Name_Save");
            string caption = Management.UserLanguage.GetOutputString("ModCollectionDialog_Caption_Save");
            string message = Management.UserLanguage.GetOutputString("ModCollectionDialog_Message_Save");
            var    result  = ExtraDialog.ShowInputDialog(ref name, caption, message);

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                Management.ModManagement.Save();
                Management.MainDataModel.Settings.ModCollections.Add(new Sonic3AIR_ModManager.Settings.ModCollection(Management.ModManagement.S3AIRActiveMods.ActiveClass, name));
                SaveModManagerSettings();
            }
        }
Exemple #3
0
        public static void RenameModCollection(GenerationsLib.WPF.Controls.RecentsListMenuItem.RecentItem e)
        {
            var    collection = e.Content as Settings.ModCollection;
            string name       = collection.Name;
            string caption    = Management.UserLanguage.GetOutputString("ModCollectionDialog_Caption_Rename");
            string message    = Management.UserLanguage.GetOutputString("ModCollectionDialog_Message_Rename");
            var    result     = ExtraDialog.ShowInputDialog(ref name, caption, message);

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                Management.ModManagement.Save();
                int collectionsIndex = Management.MainDataModel.Settings.ModCollections.IndexOf(collection);
                Management.MainDataModel.Settings.ModCollections[collectionsIndex].Name = name;
                SaveModManagerSettings();
            }
        }
        public static void AddModsFromURL()
        {
            string url = "";

            if (ExtraDialog.ShowInputDialog(ref url, Program.LanguageResource.GetString("EnterModURL")) == DialogResult.OK)
            {
                if (url != "")
                {
                    MessageBox.Show(Program.LanguageResource.GetString("InvalidURL"), Program.LanguageResource.GetString("InvalidURL"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (!Uri.IsWellFormedUriString(url, UriKind.Absolute))
                {
                    MessageBox.Show(Program.LanguageResource.GetString("InvalidURL"), Program.LanguageResource.GetString("InvalidURL"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    DownloadMod(url, false);
                }
            }
        }
        public static void AddNewModSubfolder(object selectedItem)
        {
            string       newFolderName = Program.LanguageResource.GetString("NewSubFolderEntryName");
            DialogResult result;

            result = ExtraDialog.ShowInputDialog(ref newFolderName, Program.LanguageResource.GetString("CreateSubFolderDialogTitle"), Program.LanguageResource.GetString("CreateSubFolderDialogCaption1"));
            while (Directory.Exists(Path.Combine(Management.ProgramPaths.Sonic3AIRModsFolder, newFolderName)) && (result != System.Windows.Forms.DialogResult.Cancel || result != System.Windows.Forms.DialogResult.Abort))
            {
                result = ExtraDialog.ShowInputDialog(ref newFolderName, Program.LanguageResource.GetString("CreateSubFolderDialogTitle"), Program.LanguageResource.GetString("CreateSubFolderDialogCaption2"));
            }

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                string newDirectoryPath = Path.Combine(Management.ProgramPaths.Sonic3AIRModsFolder, newFolderName);
                Directory.CreateDirectory(newDirectoryPath);
                if (selectedItem != null && selectedItem is ModViewerItem)
                {
                    MoveMod((selectedItem as ModViewerItem).Source, newDirectoryPath);
                }
            }
        }