User Tools

Site Tools


notes:csharp:reflection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
notes:csharp:reflection [2017/12/07]
leszek [Attributes]
notes:csharp:reflection [2019/01/31]
leszek [Reflection in C#]
Line 7: Line 7:
   * calling the //GetType// method on an instance to obtain its type at runtime   * calling the //GetType// method on an instance to obtain its type at runtime
   * using the //typeof// operator on a type name to obtain the type at compile time   * using the //typeof// operator on a type name to obtain the type at compile time
 +
 +Example: Get the name of the calling routine:
 +<code csharp>
 +string methodName = new StackTrace().GetFrame(1).GetMethod().Name;​
 +</​code>​
  
 ====GetType and typeof==== ====GetType and typeof====
notes/csharp/reflection.txt ยท Last modified: 2019/01/31 by leszek