During reflection, is it possible in C# to check whether one constructor calls another?
class Test
{
public Test() : this( false ) { }
public Test( bool inner ) { }
}
I would like to determine for each ConstructorInfo
whether or not it's at the end of chain of invocation.
Consider looking at Cecil or Roslyn.
Cecil operates on the compiled assembly, like Reflection does. it has higher-level libraries built on top of it to support refactorings in the SharpDevelop IDE, so it might have something to make this easier.
Roslyn operates on source code and gives you an object model based on that, so if you're willing to work against the source instead of binaries, it might be even easier to work with.
(I've never actually used Cecil for anything like this and I've never used Roslyn at all, so I can't do much more than point you at the projects and wish you luck. If you do manage to get something working, I'd be interested to hear how it went!)