|
using System;
namespace Snippets
{
/// <summary>
/// Implementation of INotifyPropertyChanged
/// </summary>
[AttributeUsage(AttributeTargets.Class , AllowMultiple = true)]
public class SnippetINotifyPropertyChanged : Attribute
{
/// <summary>
/// Gets the code snippet
/// </summary>
public string GetSnippet()
{
return @"
#region INotifyPropertyChanged Members
/// <summary>
/// Occurs when a property changes
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Raises a PropertyChanged event
/// </summary>
protected void OnPropertyChanged(string property)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(property));
}
}
#endregion
$end$";
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.