Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
        /// <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);
        }
Esempio n. 4
0
 public VSharpTypeResolveContext WithUsingScope(ResolvedUsingScope usingScope)
 {
     return(new VSharpTypeResolveContext(assembly, usingScope, currentTypeDefinition, currentMember, methodTypeParameterNames));
 }