Awesome, that makes it much easier :) On Nov 10, 12:05 pm, Jb Evain <[email protected]> wrote: > Hi Jeff, > > On Wed, Nov 10, 2010 at 5:56 PM, Jeff Nevins <[email protected]> wrote: > > To do this I think I need to replace all field initializers and new > > instance initializers in methods. The methods part I can handle but > > the field initializers I’m not sure about…They have a value called > > InitialValue which has a byte array, but I’m not sure how to use this > > to replace the initializer with a constructor for my new type. > > C# fields initializers are compiled into the constructors of the type, > so you just have to worry about visiting every method body and replace > the newobj operands you're interested in. > > FieldDefinition.InitialValue is something different entirely, as it's > used to populate large literal arrays.
-- -- mono-cecil
