Descriptor for a field of a class defined in another assembly/module
상속: Field
예제 #1
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 /// <summary>
 /// Create the FieldRef equivalent to this FieldDef.  If one does not
 /// exist then create it.
 /// </summary>
 /// <returns>FieldRef for this FieldDef</returns>
 public FieldRef MakeRefOf()
 {
     if (refOf != null) return refOf;
     ClassRef parRef = ((ClassDef)parent).MakeRefOf();
     refOf = parRef.GetField(name);
     if (refOf == null) {
         Type refType;
         if (type is ClassDef) {
             refType = ((ClassDef)type).MakeRefOf();
         } else {
             refType = type;
         }
         refOf = new FieldRef(parRef,name,refType);
         refOf.defOf = this;
     }
     return refOf;
 }
예제 #2
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 internal static void GetFieldRefs(PEReader buff, uint num, ClassRef parent)
 {
     for (int i=0; i < num; i++) {
         uint flags = buff.ReadUInt16();
         string name = buff.GetString();
         uint sigIx = buff.GetBlobIx();
         if ((flags & (uint)FieldAttr.Public) == (uint)FieldAttr.Public) {
             if (parent.GetField(name) == null) {
                 //Console.WriteLine(parent.NameString());
                 buff.currentClassScope = parent;
                 FieldRef fRef = new FieldRef(parent,name,buff.GetFieldType(sigIx));
                 buff.currentClassScope = null;
                 parent.AddToFieldList(fRef);
             }
         }
     }
 }
예제 #3
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 internal void AddField(FieldRef fld)
 {
     fields.Add(fld);
     fld.SetParent(this);
 }
예제 #4
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 /// <summary>
 /// Add a field to this class
 /// </summary>
 /// <param name="name">field name</param>
 /// <param name="fType">field type</param>
 /// <returns>a descriptor for this field</returns>
 public FieldRef AddField(string name, Type fType)
 {
     FieldRef fld = (FieldRef)FindField(name);
     if (fld != null) DescriptorError(fld);
     fld = new FieldRef(this,name,fType);
     fields.Add(fld);
     return fld;
 }
예제 #5
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 internal void AddToFieldList(FieldRef fld)
 {
     defaultClass.AddToFieldList(fld);
 }
예제 #6
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 /// <summary>
 /// Add a field to this scope.
 /// </summary>
 /// <param name="fld">The field to be added</param>
 public void AddField(FieldRef fld)
 {
     defaultClass.AddField(fld);
 }
예제 #7
0
파일: PERWAPI.cs 프로젝트: nomit007/f4
 internal static void ReadMember(PEReader buff, TableRow[] members)
 {
     for (int i=0; i < members.Length; i++) {
         uint parenIx = buff.GetCodedIndex(CIx.MemberRefParent);
         string memName = buff.GetString();
         uint sigIx = buff.GetBlobIx();
         if (buff.FirstBlobByte(sigIx) == Field.FieldTag) // got a field
             members[i] = new FieldRef(parenIx,memName,sigIx);
         else
             members[i] = new MethodRef(parenIx,memName,sigIx);
     }
 }