Exemplo n.º 1
0
        public T4Environment([NotNull] IVsEnvironmentInformation vsEnvironmentInformation, [NotNull] RawVsServiceProvider rawVsServiceProvider)
        {
            _vsEnvironmentInformation = vsEnvironmentInformation;

            _components = Lazy.Of(() => new Optional<ITextTemplatingComponents>(rawVsServiceProvider.Value.GetService<STextTemplating, ITextTemplatingComponents>()));

            int vsMajorVersion = vsEnvironmentInformation.VsVersion2.Major;
            switch (vsMajorVersion) {

                case VsVersions.Vs2010:
                    _platformID = new PlatformID(FrameworkIdentifier.NetFramework, new Version(4, 0));
                    _textTemplatingAssemblyNames = new[] {
                        "Microsoft.VisualStudio.TextTemplating.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
                        "Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                    };
                    break;

                case VsVersions.Vs2012:
                    _platformID = new PlatformID(FrameworkIdentifier.NetFramework, new Version(4, 5));
                    _textTemplatingAssemblyNames = new[] {
                        "Microsoft.VisualStudio.TextTemplating.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
                        "Microsoft.VisualStudio.TextTemplating.Interfaces.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
                        "Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                    };
                    break;

                case VsVersions.Vs2013:
                    _platformID = new PlatformID(FrameworkIdentifier.NetFramework, new Version(4, 5));
                    _textTemplatingAssemblyNames = new[] {
                        "Microsoft.VisualStudio.TextTemplating.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
                        "Microsoft.VisualStudio.TextTemplating.Interfaces.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
                        "Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                    };
                    break;

                case VsVersions.Vs2015:
                    _platformID = new PlatformID(FrameworkIdentifier.NetFramework, new Version(4, 5));
                    _textTemplatingAssemblyNames = new[] {
                        "Microsoft.VisualStudio.TextTemplating.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
                        "Microsoft.VisualStudio.TextTemplating.Interfaces.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
                        "Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                    };
                    break;

                default:
                    _textTemplatingAssemblyNames = EmptyArray<string>.Instance;
                    break;

            }
        }
Exemplo n.º 2
0
 public EncodingDirectiveAttributeInfo([NotNull] string name, DirectiveAttributeOptions options)
     : base(name, options)
 {
     _encodings = Lazy.Of(CreateEncodings, true);
 }
 public CultureDirectiveAttributeInfo([NotNull] string name, DirectiveAttributeOptions options)
     : base(name, options)
 {
     _cultureCodes = Lazy.Of(CreateCultureCodes, true);
 }
 public EncodingDirectiveAttributeInfo([NotNull] string name, DirectiveAttributeOptions options)
     : base(name, options)
 {
     _encodings = Lazy.Of(CreateEncodings, true);
 }
 public CultureDirectiveAttributeInfo([NotNull] string name, DirectiveAttributeOptions options)
     : base(name, options)
 {
     _cultureCodes = Lazy.Of(CreateCultureCodes, true);
 }