Exemple #1
0
        private void Init()
        {
            UpdateModsConfig config = ConfigurationManager.UpdateModsConfiguration;

            ModsDirTextBox.Text   = config.ModsDirectory;
            OwnerTextBox.Text     = config.Owner;
            CodeRepoTextBox.Text  = config.Repository;
            MataInfoTextBox.Text  = config.InfoFile;
            FileTypeCombpBox.Text = config.FileType;
        }
Exemple #2
0
        private bool SetNewConfig()
        {
            UpdateModsConfig config = ConfigurationManager.UpdateModsConfiguration;
            string           path   = ModsDirTextBox.Text.Trim();

            if (!Directory.Exists(path))
            {
                AlertSnackbarMessage.Content = "Mods文件夹不存在,保存失败";
                return(false);
            }

            config.ModsDirectory = path;
            config.Owner         = OwnerTextBox.Text.Trim();
            config.Repository    = CodeRepoTextBox.Text.Trim();
            config.InfoFile      = MataInfoTextBox.Text.Trim();
            config.FileType      = FileTypeCombpBox.Text.Trim();

            AlertSnackbarMessage.Content = "保存成功";
            return(true);
        }