GetField() public method

Get the descriptor for the field "name" for this class
public GetField ( string name ) : FieldRef
name string Field name
return FieldRef
Ejemplo n.º 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);
             }
         }
     }
 }
Ejemplo n.º 2
0
        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;
        }