示例#1
0
        internal override void ResolveParent(PEReader buff, bool isExtern)
        {
            if (parent != null)
            {
                return;
            }
            CIx cIx = CIx.ResolutionScope;

            if (isExtern)
            {
                cIx = CIx.Implementation;
            }
            parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx);
            parent.ResolveParent(buff, isExtern);
            parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx);
            if (parent == null)
            {
                return;
            }
            NestedClassRef existing = parent.GetNestedClass(Name);

            if (existing == null)
            {
                scope = parent.GetScope();
                parent.AddToClassList(this);
            }
            else if (isExtern)
            {
                buff.InsertInTable(MDTable.ExportedType, Row, existing);
            }
            else
            {
                buff.InsertInTable(MDTable.TypeRef, Row, existing);
            }
        }
示例#2
0
 /// <summary>
 /// Get the scope of this ClassRef (either ModuleRef or AssemblyRef)
 /// </summary>
 /// <returns>Descriptor for the scope containing this class</returns>
 public override ReferenceScope GetScope()
 {
     if (scope == null)
     {
         scope = parent.GetScope();
     }
     return(scope);
 }
示例#3
0
 internal override void ResolveParent(PEReader buff, bool isExtern)
 {
     if (parent != null) return;
     CIx cIx = CIx.ResolutionScope;
     if (isExtern) cIx = CIx.Implementation;
     parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx);
     parent.ResolveParent(buff, isExtern);
     parent = (ClassRef)buff.GetCodedElement(cIx, resScopeIx);
     if (parent == null) return;
     NestedClassRef existing = parent.GetNestedClass(Name);
     if (existing == null)
     {
         scope = parent.GetScope();
         parent.AddToClassList(this);
     }
     else if (isExtern)
         buff.InsertInTable(MDTable.ExportedType, Row, existing);
     else
         buff.InsertInTable(MDTable.TypeRef, Row, existing);
 }
示例#4
0
 /*-------------------- Constructors ---------------------------------*/
 internal NestedClassRef(ClassRef parent, string name)
     : base(parent.GetScope(), "", name)
 {
     this.parent = parent;
 }
示例#5
0
        /*-------------------- Constructors ---------------------------------*/

        internal NestedClassRef(ClassRef parent, string name)
            : base(parent.GetScope(), "", name)
        {
            this.parent = parent;
        }