Click here to Skip to main content
15,901,035 members

Comments by pin361 (Top 1 by date)

pin361 7-May-15 5:52am View    
Can you please describe the solution with StackTrace class?
For example we have:

public class A { public SomeType v get {new SomeType(); } }
public class B { public A a {get {new A(); }} }
public class C { public B b {get {new B(); }} }

public class Test {
public void Foo(object prop) {
if(typeof(SomeType).IsAssignableFrom(prop.GetType()))
// Get prop path using StackTrace
};
public Test1() {
Test(new C().b.a.v);
}
}

Thank you