コード例 #1
0
        private void MoveFileMenuHeader_Click(object sender, RoutedEventArgs e)
        {
            string           gameModDirectory = Properties.Settings.Default.GameFolderModDirectory;
            MessageBoxResult result           = MessageBox.Show(
                "This will copy all local generated xmls files at " +
                XmlFileManager.ModConfigOutputPath + "\n" +
                " and replace the files at \n" +
                Path.Combine(gameModDirectory, Properties.Settings.Default.ModTagSetting) + "\n" +
                "Are you sure?",
                "Stage Generated XMLS",
                MessageBoxButton.OKCancel,
                MessageBoxImage.Warning);

            switch (result)
            {
            case MessageBoxResult.OK:
                //User clicked move before setting the Game Mod folder
                if (String.IsNullOrEmpty(gameModDirectory))
                {
                    HandleMissingGameModDirectory();
                }
                //Make sure they set the Game mod directory
                if (!String.IsNullOrEmpty(Properties.Settings.Default.GameFolderModDirectory))
                {
                    XmlFileManager.CopyAllOutputFiles();
                }
                break;
            }
        }
コード例 #2
0
        private void SaveFile()
        {
            string xmlOut    = XmlOutputBox.Text;
            string isInvalid = XmlXpathGenerator.ValidateXml(xmlOut);

            if (isInvalid != null)
            {
                MessageBoxResult saveInvalidXmlDecision = MessageBox.Show(
                    "The xml is not valid! Would you like to save anyway?\n\n" + isInvalid,
                    "Invalid XML!",
                    MessageBoxButton.YesNo,
                    MessageBoxImage.Error);
                switch (saveInvalidXmlDecision)
                {
                case MessageBoxResult.No:
                    return;
                }
            }
            string parentPath = Wrapper.XmlFile.ParentPath ?? "";

            if (!String.IsNullOrEmpty(xmlOut))
            {
                XmlFileManager.WriteStringToFile(Path.Combine(this.FileLocationPath, parentPath), Wrapper.XmlFile.FileName, xmlOut);
                if (Properties.Settings.Default.AutoMoveMod)
                {
                    XmlFileManager.CopyAllOutputFiles();
                }
                StartingFileContents = xmlOut;
                this.Title           = this.StartingTitle;
            }
        }
コード例 #3
0
        private void SaveXmlFile_Click(object sender, RoutedEventArgs e)
        {
            string autoMoveString = "";

            if (!Properties.Settings.Default.AutoMoveDecisionMade)
            {
                CheckAutoMoveProperty("You can change this setting later using the Settings menu.");
            }
            if (Properties.Settings.Default.AutoMoveMod)
            {
                autoMoveString = "Auto move is active! This will also automatically move the files to \n" +
                                 Properties.Settings.Default.GameFolderModDirectory;
            }
            MessageBoxResult result = MessageBox.Show(
                "This will write all current generated xml to the appropriate files in the output location.\n\n" +
                "Are you sure?\n" +
                autoMoveString,
                "Save Generated XML",
                MessageBoxButton.OKCancel,
                MessageBoxImage.Warning);

            switch (result)
            {
            case MessageBoxResult.OK:
                XmlXpathGenerator.SaveAllGeneratedXmlToPath(NewObjectFormsPanel, XmlFileManager.ModConfigOutputPath, true);
                if (Properties.Settings.Default.AutoMoveMod)
                {
                    XmlFileManager.CopyAllOutputFiles();
                }
                this.MainWindowFileController.LoadCustomTagWrappers(Properties.Settings.Default.ModTagSetting, this.CurrentModFilesCenterViewComboBox);
                this.SearchViewModSelectionPanel.Children.Remove(this.LoadedModFilesSearchViewComboBox);
                this.SearchViewModSelectionPanel.Children.Remove(this.LoadedModFilesButton);
                break;
            }
        }