Is there any generic way I can solve this so I can make sure my code
is injected after the call to the base constructor?
Regards
Bernhard Richter
Gábor Kozár
unread,
Dec 23, 2011, 10:54:10 AM12/23/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mono-...@googlegroups.com
That should be pretty simple. When you're modifying a constructor method, just look for the first instruction after which the evaluation stack is empty. That should be the constructor delegation call.
(Disclaimer: I'm not way an IL expert, so I'm not 100% sure about this, but I'd try it this way.)
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mono-...@googlegroups.com
Look for a *call* to a .ctor, there should be only 1. (new is used to instantiate while call is only used for base/this calls)
-- Carlo Kok RemObjects Software
Jb Evain
unread,
Dec 23, 2011, 4:09:22 PM12/23/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mono-...@googlegroups.com
On Dec 23, 2011, at 9:31 PM, Carlo Kok wrote: > Look for a *call* to a .ctor, there should be only 1. (new is used to instantiate while call is only used for base/this calls)
Except when creating structs with a non default ctor ;)