Ejemplo n.º 1
0
 protected virtual CodeDomProvider CreateCodeDomProvider(ProjectPlatformSettings settings)
 {
     switch (settings.Language)
     {
         case GenerationTargetLanguage.CSharp:
             return new CSharpCodeProvider();
         case GenerationTargetLanguage.VB:
             return new VBCodeProvider();
         default:
             throw new NotSupportedException();
     }
 }
Ejemplo n.º 2
0
        private TestUpToDateChecker CreateUpToDateChecker()
        {
            var net35CSSettings = new ProjectPlatformSettings
            {
                Language = GenerationTargetLanguage.CSharp,
                LanguageVersion = new Version("3.0"),
                Platform = GenerationTargetPlatform.DotNet,
                PlatformVersion = new Version("3.5"),
            };

            return new TestUpToDateChecker(TestHeaderWriterStub.Object, 
                new GeneratorInfo { GeneratorVersion = TestGeneratorFactory.GeneratorVersion}, 
                new ProjectSettings { ProjectFolder = Path.GetTempPath(), ProjectPlatformSettings = net35CSSettings });
        }
Ejemplo n.º 3
0
 private ProjectPlatformSettings ProjectPlatformSettings()
 {
     var projectPlatformSettings = new ProjectPlatformSettings();
     try
     {
         if (project.FullName.EndsWith(".vbproj"))
         {
             projectPlatformSettings.Language = GenerationTargetLanguage.VB;
             projectPlatformSettings.LanguageVersion = new Version("9.0");
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex, "ProjectPlatformSettings");
     }
     return projectPlatformSettings;
 }
Ejemplo n.º 4
0
        protected override ProjectSettings GetProjectSettings()
        {
            tracer.Trace("Discover project settings", "VsGeneratorServices");

            ProjectPlatformSettings projectPlatformSettings;
            var tergetLanguage = VsProjectScope.GetTargetLanguage(project);
            switch (tergetLanguage)
            {
                case ProgrammingLanguage.CSharp:
                    projectPlatformSettings = new ProjectPlatformSettings
                    {
                        Language = GenerationTargetLanguage.CSharp,
                        LanguageVersion = new Version("3.0"),
                        Platform = GenerationTargetPlatform.DotNet,
                        PlatformVersion = new Version("3.5"),
                    };
                    break;
                case ProgrammingLanguage.VB:
                    projectPlatformSettings = new ProjectPlatformSettings
                    {
                        Language = GenerationTargetLanguage.VB,
                        LanguageVersion = new Version("9.0"),
                        Platform = GenerationTargetPlatform.DotNet,
                        PlatformVersion = new Version("3.5"),
                    };
                    break;
                default:
                    throw new NotSupportedException("target language not supported");
            }

            var configurationHolder = configurationReader.ReadConfiguration();
            return new ProjectSettings
                       {
                           ProjectName = Path.GetFileNameWithoutExtension(project.FullName),
                           AssemblyName = VsxHelper.GetProjectAssemblyName(project),
                           ProjectFolder = VsxHelper.GetProjectFolder(project),
                           DefaultNamespace = VsxHelper.GetProjectDefaultNamespace(project),
                           ProjectPlatformSettings = projectPlatformSettings,
                           ConfigurationHolder = configurationHolder
                       };
        }
Ejemplo n.º 5
0
        public virtual void Setup()
        {
            net35CSSettings = new ProjectPlatformSettings
                                  {
                                      Language = GenerationTargetLanguage.CSharp,
                                      LanguageVersion = new Version("3.0"),
                                      Platform = GenerationTargetPlatform.DotNet,
                                      PlatformVersion = new Version("3.5"),
                                  };
            net35VBSettings = new ProjectPlatformSettings
                                  {
                                      Language = GenerationTargetLanguage.VB,
                                      LanguageVersion = new Version("9.0"),
                                      Platform = GenerationTargetPlatform.DotNet,
                                      PlatformVersion = new Version("3.5"),
                                  };

            net35CSProjectSettings = new ProjectSettings { ProjectFolder = Path.GetTempPath(), ProjectPlatformSettings = net35CSSettings };
            net35VBProjectSettings = new ProjectSettings { ProjectFolder = Path.GetTempPath(), ProjectPlatformSettings = net35VBSettings };
            defaultSettings = new GenerationSettings();

            TestHeaderWriterStub = new Mock<ITestHeaderWriter>();
            TestUpToDateCheckerStub = new Mock<ITestUpToDateChecker>();
        }
Ejemplo n.º 6
0
 public ProjectSettings()
 {
     ProjectPlatformSettings = new ProjectPlatformSettings();
     ConfigurationHolder     = new SpecFlowConfigurationHolder();
 }
Ejemplo n.º 7
0
 public ProjectSettings()
 {
     ProjectPlatformSettings = new ProjectPlatformSettings();
     ConfigurationHolder = new SpecFlowConfigurationHolder();
 }