GetField() public method

Get the descriptor for the field "name" for this class
public GetField ( string name ) : FieldRef
name string Field name
return FieldRef
Example #1
0
 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);
             }
         }
     }
 }
        internal static FieldRef AddField(ClassRef classRef, string name, PERWAPI.Type type)
        {
            FieldRef field = classRef.GetField(name);

            if (field == null)
                field = classRef.AddField(name, type);

            return field;
        }