C# Класс SourceWriter.AppPreferences

Наследование: NSObject
Показать файл Открыть проект

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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.

Описание методов

AppPreferences() публичный Метод

Initializes a new instance of the SourceWriter.AppPreferences class.
public AppPreferences ( ) : System
Результат System

LoadBool() публичный Метод

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.
Результат bool

LoadColor() публичный Метод

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.
Результат NSColor

LoadInt() публичный Метод

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.
Результат int

NSColorFromHexString() публичный Метод

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.
Результат NSColor

NSColorToHexString() публичный Метод

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.
Результат string

SaveBool() публичный Метод

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.
Результат void

SaveColor() публичный Метод

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.
Результат void

SaveInt() публичный Метод

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.
Результат void