<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Attributes on Gabriel Mongeon</title><link>https://gabrielmongeon.ca/en/tags/attributes/</link><description>Recent content in Attributes on Gabriel Mongeon</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 14 Mar 2012 20:45:46 -0400</lastBuildDate><atom:link href="https://gabrielmongeon.ca/en/tags/attributes/index.xml" rel="self" type="application/rss+xml"/><item><title>Visual Studio 11: Caller Attributes</title><link>https://gabrielmongeon.ca/en/2012/03/visual-studio-11-caller-attributes/</link><pubDate>Wed, 14 Mar 2012 20:45:46 -0400</pubDate><guid>https://gabrielmongeon.ca/en/2012/03/visual-studio-11-caller-attributes/</guid><description>&lt;p>One of the new features of &lt;a href="http://www.microsoft.com/visualstudio/11/">Visual Studio 11&lt;/a> and the .NET Framework 4.5 are the Caller attributes:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.callermembernameattribute%28v=vs.110%29.aspx">CallerMemberName&lt;/a>: allows you to obtain the method or property name of the caller to the method.&lt;/li>
&lt;li>&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.callerfilepathattribute%28v=vs.110%29.aspx">CallerFilePath&lt;/a>: allows you to obtain the full path of the source file that contains the caller. This is the file path at compile time.&lt;/li>
&lt;li>&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.callerlinenumberattribute%28v=vs.110%29.aspx">CallerLineNumber&lt;/a>: allows you to obtain the line number in the source file at which the method is called.&lt;/li>
&lt;/ul>
&lt;p>These attributes help to simplify the code in certain scenarios, such as logging or when using the INotifyPropertyChanged interface (as in MVVM) and you need to pass the name of the calling property.&lt;/p></description></item></channel></rss>