Exemplo n.º 1
0
 static public void AddLoadInitializer(this FieldDefinition item, IEnumerable <Instruction> instructions)
 {
     if (item.IsStatic)
     {
         item.AddEmptyInitializer(
             instructions
             .Append(Instruction.Create(OpCodes.Stsfld, item))
             );
     }
     else
     {
         item.AddEmptyInitializer(
             instructions
             .Prepend(Instruction.Create(OpCodes.Ldarg_0))
             .Append(Instruction.Create(OpCodes.Stfld, item))
             );
     }
 }
Exemplo n.º 2
0
 static public void AddEmptyInitializer(this FieldDefinition item, params Instruction[] instructions)
 {
     item.AddEmptyInitializer((IEnumerable <Instruction>)instructions);
 }