コード例 #1
0
 internal FieldInfo RenewField(FieldStructure field)
 {
     if (Info.GetType().Name == "TypeBuilderInstantiation")
     {
         return TypeBuilder.GetField(Info, field.GainField());
     }
     else
     {
         var f = field.GainField();
         var ret = Info.GetField(f.Name);
         if(ret == null)
         {
             throw new InvalidOperationException();
         }
         return ret;
     }
 }
コード例 #2
0
 internal void GenerateLoadAddress(FieldStructure field)
 {
     var fb = field.GainField();
     if (fb.IsStatic)
     {
         Generator.Emit(OpCodes.Ldsflda, fb);
     }
     else
     {
         Generator.Emit(OpCodes.Ldflda, fb);
     }
 }
コード例 #3
0
 internal void GenerateStore(FieldStructure field)
 {
     var fb = field.GainField();
     if (fb.IsStatic)
     {
         Generator.Emit(OpCodes.Stsfld, fb);
     }
     else
     {
         Generator.Emit(OpCodes.Stfld, fb);
     }
 }
コード例 #4
0
 internal override BuilderStructure RenewInstance(TypeStructure type)
 {
     var ret = new FieldStructure();
     ret.Info = type.RenewField(this);
     return ret;
 }