private VSharpTypeResolveContext(IAssembly assembly, ResolvedUsingScope usingScope, ITypeDefinition typeDefinition, IMember member, string[] methodTypeParameterNames) { this.assembly = assembly; this.currentUsingScope = usingScope; this.currentTypeDefinition = typeDefinition; this.currentMember = member; this.methodTypeParameterNames = methodTypeParameterNames; }
public VSharpTypeResolveContext(IAssembly assembly, ResolvedUsingScope usingScope = null, ITypeDefinition typeDefinition = null, IMember member = null) { if (assembly == null) { throw new ArgumentNullException("assembly"); } this.assembly = assembly; this.currentUsingScope = usingScope; this.currentTypeDefinition = typeDefinition; this.defaultTypeDefinition = new ResolvedTypeDefinitionSpec(this, PackageContainer.DefaultTypesContainers.ToArray()); this.currentMember = member; }
/// <summary> /// Resolves the namespace represented by this using scope. /// </summary> public ResolvedUsingScope ResolveScope(ICompilation compilation) { CacheManager cache = compilation.CacheManager; ResolvedUsingScope resolved = cache.GetShared(this) as ResolvedUsingScope; if (resolved == null) { var csContext = new VSharpTypeResolveContext(compilation.MainAssembly, parent != null ? parent.ResolveScope(compilation) : null); resolved = (ResolvedUsingScope)cache.GetOrAddShared(this, new ResolvedUsingScope(csContext, this)); } return(resolved); }
public VSharpTypeResolveContext WithUsingScope(ResolvedUsingScope usingScope) { return(new VSharpTypeResolveContext(assembly, usingScope, currentTypeDefinition, currentMember, methodTypeParameterNames)); }