Skip to content

Instantly share code, notes, and snippets.

@JoanComasFdz
Created December 28, 2011 09:13
Show Gist options
  • Save JoanComasFdz/1527219 to your computer and use it in GitHub Desktop.
Save JoanComasFdz/1527219 to your computer and use it in GitHub Desktop.
Attribute to contain a string value
/// <summary>
/// This attribute allows to attach to any
/// class, method, property or enumerator member
/// a string value.
/// </summary>
public class StringValueAttribute : Attribute
{
/// <summary>
/// Returns the attached string value.
/// </summary>
public string Value { get; private set; }
/// <summary>
/// Creates a new instance of the <see cref="StringValueAttribute">
/// with the specified value.
/// </summary>
/// <param name="value">The value you want to attach to.</param>
public StringValueAttribute(string value)
{
Value = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment