コード例 #1
0
        protected void AssertCorrectProjectConfigInfo(string expectedProjectType, string expectedFramework)
        {
            var info = ProjectConfigInfo.ReadProjectConfiguration();

            Assert.Equal(expectedProjectType, info.ProjectType);
            Assert.Equal(expectedFramework, info.Framework);
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        private void SetProjectConfigInfo()
        {
            var configInfo = ProjectConfigInfo.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);
                    ConfigFramework   = configInfo.Framework;
                    ConfigProjectType = configInfo.ProjectType;
                    ConfigPlatform    = configInfo.Platform;
                }
                else
                {
                    OnCancel();
                }
            }
            else
            {
                ConfigFramework   = configInfo.Framework;
                ConfigProjectType = configInfo.ProjectType;
                ConfigPlatform    = configInfo.Platform;
            }
        }
コード例 #4
0
        private void SetContext()
        {
            EnsureGenContextInitialized();
            if (GenContext.CurrentLanguage == _shell.GetActiveProjectLanguage())
            {
                var projectConfig = ProjectConfigInfo.ReadProjectConfiguration();
                if (projectConfig.Platform == Platforms.Uwp)
                {
                    DestinationPath = GenContext.ToolBox.Shell.GetActiveProjectPath();
                    ProjectName     = GenContext.ToolBox.Shell.GetActiveProjectName();
                }

                GenerationOutputPath   = GenContext.GetTempGenerationPath(ProjectName);
                ProjectInfo            = new ProjectInfo();
                FilesToOpen            = new List <string>();
                FailedMergePostActions = new List <FailedMergePostActionInfo>();
                MergeFilesFromProject  = new Dictionary <string, List <MergeInfo> >();
                ProjectMetrics         = new Dictionary <ProjectMetricsEnum, double>();

                GenContext.Current = this;
            }
        }
コード例 #5
0
        private void SetProjectConfigInfo()
        {
            var configInfo = ProjectConfigInfo.ReadProjectConfiguration();

            if (string.IsNullOrEmpty(configInfo.ProjectType) || string.IsNullOrEmpty(configInfo.Framework))
            {
                InfoShapeVisibility = System.Windows.Visibility.Visible;
                ProjectConfigurationWindow projectConfig = new ProjectConfigurationWindow(MainView);
                if (projectConfig.ShowDialog().Value)
                {
                    configInfo.ProjectType = projectConfig.ViewModel.SelectedProjectType.Name;
                    configInfo.Framework   = projectConfig.ViewModel.SelectedFramework.Name;
                    InfoShapeVisibility    = System.Windows.Visibility.Collapsed;
                }
                else
                {
                    Cancel();
                }
            }
            ConfigFramework   = configInfo.Framework;
            ConfigProjectType = configInfo.ProjectType;
        }