/// <summary> /// Returns a new <see cref="ICSharpProvider"/> associated to the /// <see cref="CSharpLanguage">C♯ language</see> relative /// to the <paramref name="version"/>. /// </summary> /// <param name="version">The <see cref="CSharpLanguageVersion"/> /// value which denotes what version of the language to return /// the provider for.</param> /// <returns>A new <see cref="ICSharpProvider"/> for the /// <see cref="CSharpLanguage">C♯ language</see>.</returns> public ICSharpProvider GetProvider(CSharpLanguageVersion version) { CliFrameworkVersion frameworkVersion = CliGateway.CurrentVersion; switch (version) { case CSharpLanguageVersion.Version2: frameworkVersion = CliFrameworkVersion.v2_0_50727; break; case CSharpLanguageVersion.Version3: frameworkVersion = CliFrameworkVersion.v3_5; break; case CSharpLanguageVersion.Version4: frameworkVersion = CliFrameworkVersion.v4_0_30319; break; case CSharpLanguageVersion.Version5: frameworkVersion = CliFrameworkVersion.v4_5; break; case CSharpLanguageVersion.Version6: frameworkVersion = CliFrameworkVersion.v4_6; break; default: throw new ArgumentOutOfRangeException("version"); } return(this.GetProvider(version, new IntermediateCliManager(IntermediateCliGateway.GetRuntimeEnvironmentInfo(CliGateway.CurrentPlatform, frameworkVersion)))); }
private static CliFrameworkVersion GetVersion(string versionId) { CliFrameworkVersion version = CliFrameworkVersion.CurrentVersion; string id = versionId; var idMajor = id.Substring(1, 1); var idMinor = id.Substring(3, 1); switch (idMajor) { case "1": if (idMinor == "0") { version = CliFrameworkVersion.v1_0_3705; } else { version = CliFrameworkVersion.v1_1_4322; } break; case "2": version = CliFrameworkVersion.v2_0_50727; break; case "3": if (idMinor == "0") { version = CliFrameworkVersion.v3_0; } else { version = CliFrameworkVersion.v3_5; } break; case "4": if (idMinor == "0") { version = CliFrameworkVersion.v4_0_30319; } else { version = CliFrameworkVersion.v4_5; } break; } return(version); }
protected override CliRuntimeEnvironmentVersion GetVersion(CliRuntimeEnvironmentVersion previousVersion, XmlElement derivedVersion) { List <string> previousHintPaths = new List <string>(); CliFrameworkVersion version = GetVersion(CliRuntimeEnvironmentVersion.GetXmlVersionString(derivedVersion)); //if (derivedVersion.Name != "vre:BreakingVersion") //{ var currentVersion = previousVersion.InitialVersion; while (currentVersion != null) { previousHintPaths.AddRange(currentVersion.HintPaths); currentVersion = currentVersion.NextVersion; } //} previousHintPaths.AddRange(CliRuntimeEnvironmentVersion.GetHintPaths(derivedVersion, this.XmlNamespaceManager)); return(new CliRuntimeEnvironmentVersion(this, previousVersion, derivedVersion, CliGateway.CreateIdentityManager(CliFrameworkPlatform.AnyPlatform, version, true, false, false, ((IEnumerable <string>)previousHintPaths).Reverse().ToArray()))); }
public static IAssemblyUniqueIdentifier GetCoreLibraryIdentifier(CliFrameworkVersion version) { switch (version & CliFrameworkVersion.VersionMask) { case CliFrameworkVersion.v1_1_4322: return(mscorlibIdentifierv1_1); case CliFrameworkVersion.v2_0_50727: case CliFrameworkVersion.v3_0: case CliFrameworkVersion.v3_5: return(mscorlibIdentifierv2); case CliFrameworkVersion.v4_0_30319: case CliFrameworkVersion.v4_5: case CliFrameworkVersion.v4_6: return(mscorlibIdentifierv4); } return(mscorlibIdentifierv1); }
private static IntermediateCliManager GetIdentityManager(VisualBasicVersion version) { CliFrameworkVersion frameworkVersion = CliGateway.CurrentVersion; switch (version) { case VisualBasicVersion.Version07: frameworkVersion = CliFrameworkVersion.v1_0_3705; break; case VisualBasicVersion.Version07_1: frameworkVersion = CliFrameworkVersion.v1_1_4322; break; case VisualBasicVersion.Version08: frameworkVersion = CliFrameworkVersion.v2_0_50727; break; case VisualBasicVersion.Version09: frameworkVersion = CliFrameworkVersion.v3_5; break; case VisualBasicVersion.Version10: frameworkVersion = CliFrameworkVersion.v4_0_30319; break; case VisualBasicVersion.Version11: frameworkVersion = CliFrameworkVersion.v4_5; break; case VisualBasicVersion.Version12: frameworkVersion = CliFrameworkVersion.v4_6; break; default: throw new ArgumentOutOfRangeException("version"); } var identityManager = new IntermediateCliManager(IntermediateCliGateway.GetRuntimeEnvironmentInfo(CliGateway.CurrentPlatform, frameworkVersion)); return(identityManager); }
/// <summary> /// Creates a new <see cref="IntermediateCliRuntimeEnvironmentInfo"/> /// instance with the <paramref name="resolveCurrent"/>, <paramref name="platform"/>, /// <paramref name="version"/>, <paramref name="additionalResolutionPaths"/>, /// <paramref name="useCoreLibrary"/>, and <paramref name="useGlobalAccessCache"/> /// provided. /// </summary> /// <param name="resolveCurrent"> /// A <see cref="Boolean"/> value denoting whether to resolve identities /// within the <see cref="ApplicationDirectory"/>.</param> /// <param name="platform">A <see cref="CliFrameworkPlatform"/> value /// denoting the base platform to use.</param> /// <param name="version">A <see cref="CliFrameworkVersion"/> denoting the /// target framework.</param> /// <param name="additionalResolutionPaths">A series of <see cref="String"/> /// values denoting the additional paths to perform identity resolution.</param> /// <param name="useCoreLibrary">A <see cref="Boolean"/> value denoting /// whether to use the core library identifier to resolve standard identities. /// </param> /// <param name="useGlobalAccessCache">A <see cref="Boolean"/> /// value denoting whether to use the global access cache.</param> internal IntermediateCliRuntimeEnvironmentInfo(bool resolveCurrent, CliFrameworkPlatform platform, CliFrameworkVersion version, string[] additionalResolutionPaths, bool useCoreLibrary, bool useGlobalAccessCache) : base(resolveCurrent, platform, version, additionalResolutionPaths, useCoreLibrary, useGlobalAccessCache) { }
public CliAssemblyUniqueIdentifier(IAssemblyUniqueIdentifier uniqueIdentifier, CliFrameworkVersion targetFramework) : base(uniqueIdentifier.Name, uniqueIdentifier.Version, uniqueIdentifier.Culture, uniqueIdentifier.PublicKeyToken) { this.TargetFramework = targetFramework; }
/// <summary> /// Creates a new <see cref="IntermediateCliRuntimeEnvironmentInfo"/> /// instance with the <paramref name="resolveCurrent"/>, <paramref name="platform"/>, /// <paramref name="version"/>, <paramref name="useCoreLibrary"/>, and /// <paramref name="useGlobalAccessCache"/> provided. /// </summary> /// <param name="resolveCurrent"> /// A <see cref="Boolean"/> value denoting whether to resolve identities /// within the <see cref="ApplicationDirectory"/>.</param> /// <param name="platform">A <see cref="CliFrameworkPlatform"/> value /// denoting the base platform to use.</param> /// <param name="version">A <see cref="CliFrameworkVersion"/> denoting the /// target framework.</param> /// <param name="useCoreLibrary">A <see cref="Boolean"/> value denoting /// whether to use the core library identifier to resolve standard identities. /// </param> /// <param name="useGlobalAccessCache">A <see cref="Boolean"/> /// value denoting whether to use the global access cache.</param> public IntermediateCliRuntimeEnvironmentInfo( bool resolveCurrent, CliFrameworkPlatform platform, CliFrameworkVersion version, bool useCoreLibrary, bool useGlobalAccessCache) : base(resolveCurrent, platform, version, useCoreLibrary, useGlobalAccessCache) { }
public static ICliRuntimeEnvironmentInfo GetRuntimeEnvironmentInfo(CliFrameworkPlatform platform, CliFrameworkVersion version = CurrentVersion, bool resolveCurrent = true, bool useCoreLibrary = true, bool useGlobalAccessCache = true) { return(new CliRuntimeEnvironmentInfo(resolveCurrent, platform, version, useCoreLibrary, useGlobalAccessCache)); }
public static ICliRuntimeEnvironmentInfo GetRuntimeEnvironmentInfo(CliFrameworkPlatform platform, CliFrameworkVersion version, bool resolveCurrent, bool useCoreLibrary, bool useGlobalAccessCache, params string[] additionalResolutionPaths) { return(new CliRuntimeEnvironmentInfo(resolveCurrent, platform, version, additionalResolutionPaths, useCoreLibrary, useGlobalAccessCache)); }
public static ICliManager CreateIdentityManager(CliFrameworkPlatform platform, CliFrameworkVersion version = CliGateway.CurrentVersion, bool resolveCurrent = true, bool useCoreLibrary = true, bool useGlobalAccessCache = true) { return(CreateIdentityManager(GetRuntimeEnvironmentInfo(platform, version, resolveCurrent, useCoreLibrary, useGlobalAccessCache))); }
public static ICliManager CreateIdentityManager(CliFrameworkPlatform platform, CliFrameworkVersion version, bool resolveCurrent, bool useCoreLibrary, bool useGlobalAccessCache, params string[] additionalResolutionPaths) { return(CreateIdentityManager(GetRuntimeEnvironmentInfo(platform, version, resolveCurrent, useCoreLibrary, useGlobalAccessCache, additionalResolutionPaths))); }
private static IAssemblyUniqueIdentifier GetVersionedStandardLibrary(string libraryName, CliFrameworkVersion version, CliFrameworkVersion introducedVersion, bool ecmaLibrary, byte[] alternatePublicKey = null, IVersion[] alternateVersions = null) { switch (version & CliFrameworkVersion.VersionMask) { case CliFrameworkVersion.v1_0_3705: switch (introducedVersion & CliFrameworkVersion.VersionMask) { case CliFrameworkVersion.v1_1_4322: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v1_1Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v2_0_50727: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v2Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_0: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_0_30319: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_6: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_6Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v1Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v1_1_4322: switch (introducedVersion & CliFrameworkVersion.VersionMask) { case CliFrameworkVersion.v2_0_50727: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v2Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_0: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_0_30319: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_6: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_6Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v1_1Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v2_0_50727: switch (introducedVersion & CliFrameworkVersion.VersionMask) { case CliFrameworkVersion.v3_0: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_0_30319: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_6: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_6Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v2Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_0: switch (introducedVersion & CliFrameworkVersion.VersionMask) { case CliFrameworkVersion.v1_0_3705: case CliFrameworkVersion.v1_1_4322: case CliFrameworkVersion.v2_0_50727: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v2Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_0_30319: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_6: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_6Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_5: switch (introducedVersion & CliFrameworkVersion.VersionMask) { case CliFrameworkVersion.v1_0_3705: case CliFrameworkVersion.v1_1_4322: case CliFrameworkVersion.v2_0_50727: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v2Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v3_0: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_0_30319: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_5: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_6: return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_6Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v3_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); case CliFrameworkVersion.v4_0_30319: case CliFrameworkVersion.v4_5: case CliFrameworkVersion.v4_6: if ((introducedVersion & CliFrameworkVersion.VersionMask) == CliFrameworkVersion.v4_6) { return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_6Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } else if ((introducedVersion & CliFrameworkVersion.VersionMask) == CliFrameworkVersion.v4_5) { return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4_5Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } return(TypeSystemIdentifiers.GetAssemblyIdentifier(libraryName, CliGateway.v4Version, CultureIdentifiers.None, ecmaLibrary ? StrongNameKeyPairHelper.StandardPublicKeyToken : alternatePublicKey)); } /* * * If the version doesn't match the valid set of values, * yield the introduced version by a recursive call. * */ if (version == introducedVersion) { throw new ArgumentOutOfRangeException("No version of introducedVersion yielded a library.", "introducedVersion"); } return(GetVersionedStandardLibrary(libraryName, introducedVersion, introducedVersion, ecmaLibrary)); }
public IToySharpProvider GetProvider(ToySharpLanguageVersion version, CliFrameworkPlatform platform, CliFrameworkVersion frameworkVersion) { return(this.GetProvider(version, IntermediateCliGateway.CreateIdentityManager(platform, frameworkVersion))); }
public static IAssemblyUniqueIdentifier GetVersionedMicrosoftVisualBasicLibrary(CliFrameworkVersion version) { switch (version & ~CliFrameworkVersion.ClientProfile) { case CliFrameworkVersion.v1_0_3705: return(GetVersionedMicrosoftVisualBasicLibrary(VisualBasicVersion.Version07)); case CliFrameworkVersion.v1_1_4322: return(GetVersionedMicrosoftVisualBasicLibrary(VisualBasicVersion.Version07_1)); case CliFrameworkVersion.v2_0_50727: return(GetVersionedMicrosoftVisualBasicLibrary(VisualBasicVersion.Version08)); case CliFrameworkVersion.v3_0: case CliFrameworkVersion.v3_5: return(GetVersionedMicrosoftVisualBasicLibrary(VisualBasicVersion.Version09)); case CliFrameworkVersion.v4_0_30319: case CliFrameworkVersion.v4_5: return(GetVersionedMicrosoftVisualBasicLibrary(VisualBasicVersion.Version10)); case CliFrameworkVersion.v4_6: return(GetVersionedMicrosoftVisualBasicLibrary(VisualBasicVersion.Version12)); } return(GetVersionedMicrosoftVisualBasicLibrary(VisualBasicVersion.CurrentVersion)); }
public static IAssemblyUniqueIdentifier GetVersionedSystemLibrary(CliFrameworkVersion frameworkVersion = CliFrameworkVersion.CurrentVersion) { return(GetVersionedStandardLibrary(systemLibName, frameworkVersion, CliFrameworkVersion.v1_0_3705, true)); }
public static IAssemblyUniqueIdentifier GetVersionedCommonLanguageRuntimeLibrary(CliFrameworkVersion frameworkVersion = CliFrameworkVersion.CurrentVersion) { return(CliGateway.GetCoreLibraryIdentifier(frameworkVersion)); }