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(); } }
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 }); }
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; }
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 }; }
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>(); }
public ProjectSettings() { ProjectPlatformSettings = new ProjectPlatformSettings(); ConfigurationHolder = new SpecFlowConfigurationHolder(); }