Created
December 3, 2012 13:18
-
-
Save alexanderfast/4194998 to your computer and use it in GitHub Desktop.
ResourcedOptionAttribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class ResourcedOptionAttribute : OptionAttribute | |
{ | |
private string helpTextKey; | |
public ResourcedOptionAttribute(string shortName, string longName) | |
: base(shortName, longName) | |
{ | |
} | |
public string HelpTextKey | |
{ | |
get { return helpTextKey; } | |
set | |
{ | |
helpTextKey = value; | |
base.HelpText = Resources.ResourceManager.GetString(value); | |
} | |
} | |
public new string HelpText | |
{ | |
get { return base.HelpText; } | |
set | |
{ | |
throw new InvalidOperationException( | |
"ResourcedOption: Specify HelpTextKey instead."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment