コード例 #1
0
        public override void Visit(ITypeExport aliasForType)
        {
            this.Visit(aliasForType.GetAttributes(Context));

            // do not visit the reference to aliased type, it does not get into the type ref table based only on its membership of the exported types collection.
            // but DO visit the reference to assembly (if any) that defines the aliased type. That assembly might not already be in the assembly reference list.
            var definingUnit     = MetadataWriter.GetDefiningUnitReference(aliasForType.ExportedType, Context);
            var definingAssembly = definingUnit as IAssemblyReference;

            if (definingAssembly != null)
            {
                this.Visit(definingAssembly);
            }

            var definingModule = definingUnit as IModuleReference;

            if (definingModule != null)
            {
                definingAssembly = definingModule.GetContainingAssembly(Context);
                if (definingAssembly != null && !ReferenceEquals(definingAssembly, this.module.GetContainingAssembly(Context)))
                {
                    this.Visit(definingAssembly);
                }
            }
        }
コード例 #2
0
ファイル: ReferenceIndexer.cs プロジェクト: elemk0vv/roslyn-1
        public override void Visit(ITypeExport aliasForType)
        {
            this.Visit(aliasForType.GetAttributes(Context));

            // do not visit the reference to aliased type, it does not get into the type ref table based only on its membership of the exported types collection.
            // but DO visit the reference to assembly (if any) that defines the aliased type. That assembly might not already be in the assembly reference list.
            var definingUnit = MetadataWriter.GetDefiningUnitReference(aliasForType.ExportedType, Context);
            var definingAssembly = definingUnit as IAssemblyReference;
            if (definingAssembly != null)
            {
                this.Visit(definingAssembly);
            }

            var definingModule = definingUnit as IModuleReference;
            if (definingModule != null)
            {
                definingAssembly = definingModule.GetContainingAssembly(Context);
                if (definingAssembly != null && !ReferenceEquals(definingAssembly, this.module.GetContainingAssembly(Context)))
                {
                    this.Visit(definingAssembly);
                }
            }
        }
コード例 #3
0
ファイル: MetadataVisitor.cs プロジェクト: elemk0vv/roslyn-1
 public virtual void Visit(ITypeExport typeExport)
 {
     this.Visit(typeExport.ExportedType);
     this.Visit(typeExport.GetAttributes(Context));
     typeExport.Dispatch(this);
 }
コード例 #4
0
 public CreateBenchmark TypeOfExport(ITypeExport typeExport)
 {
     _benchmark.Exporter.AddExport(typeExport);
     return(this);
 }
コード例 #5
0
 public virtual void Visit(ITypeExport typeExport)
 {
     this.Visit(typeExport.ExportedType);
     this.Visit(typeExport.GetAttributes(Context));
     typeExport.Dispatch(this);
 }
コード例 #6
0
 public void AddExport(string nameExport, ITypeExport export)
 {
     _dicoExportType.Add(nameExport, export);
 }
コード例 #7
0
 public void AddExport(ITypeExport typeExport)
 {
     _listExport.Add(typeExport);
 }