Category: C#

Leveraging the Caller Member Name

Call Member Name Example public class Person : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public Person(string name) { Name = name; } private string _Name; public string Name { get { return _Name; } set { if (_Name != value) { _Name = value; OnPropertyChanged(); } } } private void OnPropertyChanged([CallerMemberName]string property = null) { […]

New Attributes for Trace and Logging Information in .NET 4.5

Exploring .NET 4.5 There is a new set of .NET attributes in .NET 4.5 to help with gathering trace information.  Before .NET 4.5, tracing the line number, member name, and source file name required using the stack trace in combination with the PDB files.  In .NET 4.5, however, there is a new mechanism for doing […]