Exemplo n.º 1
0
 internal override FieldInfo GetField(FieldInfo fromNoninstanciated)
 {
     initialize();
     if (fields == null)
     {
         fields = new Hashtable();
     }
     if (!fields.ContainsKey(fromNoninstanciated))
     {
         fields [fromNoninstanciated] = new FieldOnTypeBuilderInst(this, fromNoninstanciated);
     }
     return((FieldInfo)fields [fromNoninstanciated]);
 }
Exemplo n.º 2
0
        internal override FieldInfo GetField(FieldInfo fromNoninstanciated)
        {
            initialize();

            if (!(fromNoninstanciated is FieldBuilder))
            {
                throw new InvalidOperationException("Inflating non FieldBuilder objects is not supported: " + fromNoninstanciated.GetType());
            }

            FieldBuilder fb = (FieldBuilder)fromNoninstanciated;

            if (fields == null)
            {
                fields = new Hashtable();
            }
            if (!fields.ContainsKey(fb))
            {
                fields [fb] = new FieldOnTypeBuilderInst(this, fb);
            }
            return((FieldInfo)fields [fb]);
        }