Пример #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;
 }
Пример #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;
 }
Пример #3
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);
        }
Пример #4
0
 public CSharpTypeResolveContext WithUsingScope(ResolvedUsingScope usingScope)
 {
     return(new CSharpTypeResolveContext(module, usingScope, currentTypeDefinition, currentMember, methodTypeParameterNames));
 }