Exemple #1
0
 private CSharpTypeResolveContext(IModule module, ResolvedUsingScope usingScope, ITypeDefinition typeDefinition, IMember member, string[] methodTypeParameterNames)
 {
     this.module                   = module;
     this.currentUsingScope        = usingScope;
     this.currentTypeDefinition    = typeDefinition;
     this.currentMember            = member;
     this.methodTypeParameterNames = methodTypeParameterNames;
 }
Exemple #2
0
 public CSharpTypeResolveContext(IModule module, ResolvedUsingScope usingScope = null, ITypeDefinition typeDefinition = null, IMember member = null)
 {
     if (module == null)
     {
         throw new ArgumentNullException(nameof(module));
     }
     this.module                = module;
     this.currentUsingScope     = usingScope;
     this.currentTypeDefinition = typeDefinition;
     this.currentMember         = member;
 }
 public CSharpTypeResolveContext(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.currentMember         = member;
 }
Exemple #4
0
        /// <summary>
        /// Resolves the namespace represented by this using scope.
        /// </summary>
        public ResolvedUsingScope Resolve(ICompilation compilation)
        {
            CacheManager       cache    = compilation.CacheManager;
            ResolvedUsingScope resolved = cache.GetShared(this) as ResolvedUsingScope;

            if (resolved == null)
            {
                var csContext = new CSharpTypeResolveContext(compilation.MainModule, parent != null ? parent.Resolve(compilation) : null);
                resolved = (ResolvedUsingScope)cache.GetOrAddShared(this, new ResolvedUsingScope(csContext, this));
            }
            return(resolved);
        }
Exemple #5
0
 public CSharpTypeResolveContext WithUsingScope(ResolvedUsingScope usingScope)
 {
     return(new CSharpTypeResolveContext(module, usingScope, currentTypeDefinition, currentMember, methodTypeParameterNames));
 }