public IType ObtainTypeReference(RuntimeCoreType coreType, IAssembly assembly) { Dictionary <RuntimeCoreType, IType> currentCache = null; lock (lookupCache) { CheckLUC(assembly); if (assembly != null) { currentCache = lookupCache[assembly]; lock (currentCache) { if (currentCache != null) { IType result; if (currentCache.TryGetValue(coreType, out result)) { return(result); } } } } } ICliRuntimeEnvironmentInfo runtimeEnvironmentInfo = this.runtimeEnvironment; if (assembly is ICliAssembly) { ICliAssembly cliAssembly = (ICliAssembly)assembly; if (cliAssembly.RuntimeEnvironment.Version != runtimeEnvironmentInfo.Version) { runtimeEnvironmentInfo = cliAssembly.RuntimeEnvironment; } } var resultType = this.ObtainTypeReference(runtimeEnvironmentInfo.GetCoreIdentifier(coreType), assembly); if (currentCache != null) { lock (lookupCache) lock (currentCache) currentCache.Add(coreType, resultType); } return(resultType); }
public static ICliManager CreateIdentityManager(ICliRuntimeEnvironmentInfo runtimeEnvironment) { return(new CliManager(runtimeEnvironment)); }