AppKit.TextKit.Formatter.LanguageDescriptor.LoadColor C# (CSharp) Méthode

LoadColor() public méthode

Loads the requested color from system-wide user defaults.
public LoadColor ( string key, NSColor defaultValue ) : NSColor
key string The user default key for the color.
defaultValue NSColor The default NSColor value.
Résultat NSColor
		public NSColor LoadColor(string key, NSColor defaultValue) {

			// Attempt to read color, add the language ID to make unique
			var hex = NSUserDefaults.StandardUserDefaults.StringForKey(LanguageIdentifier + key);

			// Take action based on value
			if (hex == null) {
				return defaultValue;
			} else {
				return NSColorFromHexString (hex);
			}
		}