C# Class SourceWriter.AppPreferences

Inheritance: NSObject
Afficher le fichier Open project: xamarin/mac-samples

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
AppPreferences ( ) : System

Initializes a new instance of the SourceWriter.AppPreferences class.

LoadBool ( string key, bool defaultValue ) : bool

Loads the bool value from the system-wide user defaults.

LoadColor ( string key, NSColor defaultValue ) : NSColor

Loads the requested color from system-wide user defaults.

LoadInt ( string key, int defaultValue ) : int

Loads the given integer value for the specified key. If the key is not found, the default value is returned.

NSColorFromHexString ( string hexValue ) : NSColor

Converts a web formatted hex string in the form #RRGGBB or #RRGGBBAA into a color.

NSColorToHexString ( NSColor color, bool withAlpha ) : string

Converts the given color into a web style hex string in the form #RRBBGG or optionally #RRBBGGAA.

SaveBool ( string key, bool value, bool sync ) : void

Saves the bool value to the system-wide user defaults.

SaveColor ( string key, NSColor color, bool sync ) : void

Saves the given color to the systwm-wide user defaults with the give keyword.

SaveInt ( string key, int value, bool sync ) : void

Saves the given integer value to the system-wide user defaults.

Method Details

AppPreferences() public méthode

Initializes a new instance of the SourceWriter.AppPreferences class.
public AppPreferences ( ) : System
Résultat System

LoadBool() public méthode

Loads the bool value from the system-wide user defaults.
public LoadBool ( string key, bool defaultValue ) : bool
key string The key to load the value for.
defaultValue bool The default value if not found.
Résultat bool

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

LoadInt() public méthode

Loads the given integer value for the specified key. If the key is not found, the default value is returned.
public LoadInt ( string key, int defaultValue ) : int
key string Key.
defaultValue int Default value.
Résultat int

NSColorFromHexString() public méthode

Converts a web formatted hex string in the form #RRGGBB or #RRGGBBAA into a color.
public NSColorFromHexString ( string hexValue ) : NSColor
hexValue string The web formatted hex string in the form #RRGGBB or #RRGGBBAA.
Résultat NSColor

NSColorToHexString() public méthode

Converts the given color into a web style hex string in the form #RRBBGG or optionally #RRBBGGAA.
public NSColorToHexString ( NSColor color, bool withAlpha ) : string
color NSColor The NSColor to convert.
withAlpha bool If set to true with the alpha (transparency) of the color will be /// included.
Résultat string

SaveBool() public méthode

Saves the bool value to the system-wide user defaults.
public SaveBool ( string key, bool value, bool sync ) : void
key string The key to save the value to.
value bool The value to save.
sync bool If set to true sync.
Résultat void

SaveColor() public méthode

Saves the given color to the systwm-wide user defaults with the give keyword.
public SaveColor ( string key, NSColor color, bool sync ) : void
key string The user default key to assign the color to.
color NSColor The NSColor to save to the user defaults.
sync bool If set to true sync changes to preferences.
Résultat void

SaveInt() public méthode

Saves the given integer value to the system-wide user defaults.
public SaveInt ( string key, int value, bool sync ) : void
key string The key for the integer to load.
value int The value of the key.
sync bool If set to true sync changes to preferences.
Résultat void