コード例 #1
0
        public ModelSetupWizardOptionsViewModel()
        {
            Worksets         = new BindableCollection <WorksetParameter>();
            SelectedWorksets = new List <WorksetParameter>();
            ProjectInformationReplacements = new BindableCollection <ProjectInformationReplacement>();
            NominatedArchitects            = new BindableCollection <NominatedArchitect>();

            ColourSchemes = new BindableCollection <ColourScheme>();

            var loadSystemConfig = ModelSetupWizardSettings.Default.LoadSystemConfigOnStartup;

            if (loadSystemConfig)
            {
                systemConfigFilePath = ModelSetupWizardSettings.Default.SystemConfigFilePath;
                if (!string.IsNullOrEmpty(systemConfigFilePath))
                {
                    if (System.IO.File.Exists(systemConfigFilePath))
                    {
                        SettingsIO.Import(systemConfigFilePath);
                        ModelSetupWizardSettings.Default.SystemConfigFilePath      = systemConfigFilePath;
                        ModelSetupWizardSettings.Default.LoadSystemConfigOnStartup = true;
                        ModelSetupWizardSettings.Default.Save();
                    }
                    else
                    {
                        SCaddinsApp.WindowManager.ShowWarningMessageBox(
                            "File Not Found",
                            string.Format(System.Globalization.CultureInfo.InvariantCulture, "Config file: {0} not found", systemConfigFilePath));
                    }
                }
            }

            Init();
        }
コード例 #2
0
        public void ImportConfig()
        {
            var result = SCaddinsApp.WindowManager.ShowOpenFileDialog(string.Empty, out var filePath);

            if (!result.HasValue || !result.Value || !System.IO.File.Exists(filePath))
            {
                return;
            }
            SettingsIO.Import(filePath);
            Reset();
        }
コード例 #3
0
        public void SelectSytemConfigFile()
        {
            string filePath = string.Empty;
            bool?  result   = SCaddinsApp.WindowManager.ShowOpenFileDialog(string.Empty, out filePath);

            if (result.HasValue && result.Value && System.IO.File.Exists(filePath))
            {
                SettingsIO.Import(filePath);
                Reset();
            }
            SystemConfigFilePath = filePath;
        }