예제 #1
0
        private void SetProjectConfigInfo()
        {
            var configInfo = ProjectConfigInfoService.ReadProjectConfiguration();

            if (string.IsNullOrEmpty(configInfo.ProjectType) || string.IsNullOrEmpty(configInfo.Framework) || string.IsNullOrEmpty(configInfo.Platform))
            {
                var vm = new ProjectConfigurationViewModel();
                ProjectConfigurationDialog projectConfig = new ProjectConfigurationDialog(vm);
                projectConfig.Owner = WizardShell.Current;
                projectConfig.ShowDialog();

                if (vm.Result == DialogResult.Accept)
                {
                    configInfo.ProjectType = vm.SelectedProjectType.Name;
                    configInfo.Framework   = vm.SelectedFramework.Name;
                    configInfo.Platform    = vm.SelectedPlatform;
                    ProjectMetadataService.SaveProjectMetadata(configInfo, GenContext.ToolBox.Shell.GetActiveProjectPath());
                    ConfigFramework   = configInfo.Framework;
                    ConfigProjectType = configInfo.ProjectType;
                    ConfigPlatform    = configInfo.Platform;
                }
                else
                {
                    Navigation.Cancel();
                }
            }
            else
            {
                ConfigFramework   = configInfo.Framework;
                ConfigProjectType = configInfo.ProjectType;
                ConfigPlatform    = configInfo.Platform;
            }
        }
        private void SetProjectConfigInfo()
        {
            var configInfo = ProjectConfigInfo.ReadProjectConfiguration();

            if (string.IsNullOrEmpty(configInfo.ProjectType) || string.IsNullOrEmpty(configInfo.Framework))
            {
                var vm = new ProjectConfigurationViewModel();
                ProjectConfigurationDialog projectConfig = new ProjectConfigurationDialog(vm);
                projectConfig.ShowDialog();

                if (vm.Result == DialogResult.Accept)
                {
                    configInfo.ProjectType = vm.SelectedProjectType.Name;
                    configInfo.Framework   = vm.SelectedFramework.Name;
                    ProjectConfigInfo.SaveProjectConfiguration(configInfo.ProjectType, configInfo.Framework);
                    ConfigFramework   = configInfo.Framework;
                    ConfigProjectType = configInfo.ProjectType;
                }
                else
                {
                    OnCancel();
                }
            }
            else
            {
                ConfigFramework   = configInfo.Framework;
                ConfigProjectType = configInfo.ProjectType;
            }
        }