BogaNet 1.4.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Pages
Public Member Functions | Properties | List of all members
BogaNet.Prefs.IPreferences Interface Reference

Interface for preferences of the application. More...

Inheritance diagram for BogaNet.Prefs.IPreferences:
BogaNet.Prefs.IFilePreferences BogaNet.Prefs.Preferences

Public Member Functions

bool Remove (string key)
 Removes a key/value from the preferences.
 
bool ContainsKey (string key)
 Checks if a given key exists in the preferences.
 
string GetString (string key, bool obfuscated=false)
 Get a string for a key.
 
bool TryGetString (string key, out string result, bool obfuscated=false)
 Tries to get a string for a key.
 
GetObject< T > (string key, bool obfuscated=false)
 Get an object for a key.
 
bool TryGetObject< T > (string key, out T result, bool obfuscated=false)
 Tries to get an object for a key.
 
GetNumber< T > (string key, bool obfuscated=false)
 Get a number for a key.
 
bool TryGetNumber< T > (string key, out T result, bool obfuscated=false)
 Tries to get a number for a key.
 
bool GetBool (string key, bool obfuscated=false)
 Get a bool for a key.
 
bool TryGetBool (string key, out bool result, bool obfuscated=false)
 Tries to get a bool for a key.
 
DateTime GetDate (string key, bool obfuscated=false, TimeZoneInfo? usedTZ=null)
 Get a DateTime for a key.
 
bool TryGetDate (string key, out DateTime result, bool obfuscated=false, TimeZoneInfo? usedTZ=null)
 Tries to get a DateTime for a key.
 
void Set (string key, string value, bool obfuscated=false)
 Set a string for a key.
 
void Set (string key, object value, bool obfuscated=false)
 Set an object for a key.
 
void Set< T > (string key, T value, bool obfuscated=false)
 Set a number for a key.
 
void Set (string key, bool value, bool obfuscated=false)
 Set a bool for a key.
 
void Set (string key, DateTime value, bool obfuscated=false)
 Set a DateTime for a key.
 

Properties

ByteObf IV [set]
 IV for the obfuscated data.
 
bool IsLoaded [get]
 Are the preferences loaded?
 
bool IsSaved [get]
 Are the current preferences saved?
 
List< string > Keys [get]
 Current keys of the preferences.
 
int Count [get]
 Current count of keys from the preferences.
 

Detailed Description

Interface for preferences of the application.

Member Function Documentation

◆ ContainsKey()

bool BogaNet.Prefs.IPreferences.ContainsKey ( string key)

Checks if a given key exists in the preferences.

Parameters
keyKey to check
Returns
True if the key exists in the preferences
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ GetBool()

bool BogaNet.Prefs.IPreferences.GetBool ( string key,
bool obfuscated = false )

Get a bool for a key.

Parameters
keyKey for the bol.
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
Bool for the key
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ GetDate()

DateTime BogaNet.Prefs.IPreferences.GetDate ( string key,
bool obfuscated = false,
TimeZoneInfo? usedTZ = null )

Get a DateTime for a key.

Parameters
keyKey for the DateTime.
obfuscatedObfuscate value in the preferences (optional, default: false)
usedTZTime zone of the date (optional, default: local)
Returns
DateTime for the key
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ GetNumber< T >()

T BogaNet.Prefs.IPreferences.GetNumber< T > ( string key,
bool obfuscated = false )

Get a number for a key.

Parameters
keyKey for the number
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
Number for the key
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

Type Constraints
T :INumber<T> 

◆ GetObject< T >()

T BogaNet.Prefs.IPreferences.GetObject< T > ( string key,
bool obfuscated = false )

Get an object for a key.

Parameters
keyKey for the object
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
Object for the key
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ GetString()

string BogaNet.Prefs.IPreferences.GetString ( string key,
bool obfuscated = false )

Get a string for a key.

Parameters
keyKey for the string
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
String for the key
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ Remove()

bool BogaNet.Prefs.IPreferences.Remove ( string key)

Removes a key/value from the preferences.

Parameters
keyKey (and value) to delete
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ Set() [1/4]

void BogaNet.Prefs.IPreferences.Set ( string key,
bool value,
bool obfuscated = false )

Set a bool for a key.

Parameters
keyKey for the bool
valueBool for the preferences
obfuscatedObfuscate value in the preferences (optional, default: false)
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ Set() [2/4]

void BogaNet.Prefs.IPreferences.Set ( string key,
DateTime value,
bool obfuscated = false )

Set a DateTime for a key.

Parameters
keyKey for the DateTime
valueDateTime for the preferences
obfuscatedObfuscate value in the preferences (optional, default: false)
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ Set() [3/4]

void BogaNet.Prefs.IPreferences.Set ( string key,
object value,
bool obfuscated = false )

Set an object for a key.

Parameters
keyKey for the object
valueObject for the preferences
obfuscatedObfuscate value in the preferences (optional, default: false)
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ Set() [4/4]

void BogaNet.Prefs.IPreferences.Set ( string key,
string value,
bool obfuscated = false )

Set a string for a key.

Parameters
keyKey for the string
valueString for the preferences
obfuscatedObfuscate value in the preferences (optional, default: false)
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ Set< T >()

void BogaNet.Prefs.IPreferences.Set< T > ( string key,
T value,
bool obfuscated = false )

Set a number for a key.

Parameters
keyKey for the number
valueNumber for the preferences
obfuscatedObfuscate value in the preferences (optional, default: false)
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

Type Constraints
T :INumber<T> 

◆ TryGetBool()

bool BogaNet.Prefs.IPreferences.TryGetBool ( string key,
out bool result,
bool obfuscated = false )

Tries to get a bool for a key.

Parameters
keyKey for the bol.
resultout parameter for the result
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
True if the operation was successful
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ TryGetDate()

bool BogaNet.Prefs.IPreferences.TryGetDate ( string key,
out DateTime result,
bool obfuscated = false,
TimeZoneInfo? usedTZ = null )

Tries to get a DateTime for a key.

Parameters
keyKey for the DateTime.
resultout parameter for the result
obfuscatedObfuscate value in the preferences (optional, default: false)
usedTZTime zone of the date (optional, default: local)
Returns
True if the operation was successful
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ TryGetNumber< T >()

bool BogaNet.Prefs.IPreferences.TryGetNumber< T > ( string key,
out T result,
bool obfuscated = false )

Tries to get a number for a key.

Parameters
keyKey for the number
resultout parameter for the result
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
True if the operation was successful
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

Type Constraints
T :INumber<T> 

◆ TryGetObject< T >()

bool BogaNet.Prefs.IPreferences.TryGetObject< T > ( string key,
out T result,
bool obfuscated = false )

Tries to get an object for a key.

Parameters
keyKey for the object
resultout parameter for the result
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
True if the operation was successful
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

◆ TryGetString()

bool BogaNet.Prefs.IPreferences.TryGetString ( string key,
out string result,
bool obfuscated = false )

Tries to get a string for a key.

Parameters
keyKey for the string
resultout parameter for the result
obfuscatedObfuscate value in the preferences (optional, default: false)
Returns
True if the operation was successful
Exceptions
ArgumentNullException

Implemented in BogaNet.Prefs.Preferences.

Property Documentation

◆ Count

int BogaNet.Prefs.IPreferences.Count
get

Current count of keys from the preferences.

Implemented in BogaNet.Prefs.Preferences.

◆ IsLoaded

bool BogaNet.Prefs.IPreferences.IsLoaded
get

Are the preferences loaded?

Implemented in BogaNet.Prefs.Preferences.

◆ IsSaved

bool BogaNet.Prefs.IPreferences.IsSaved
get

Are the current preferences saved?

Implemented in BogaNet.Prefs.Preferences.

◆ IV

ByteObf BogaNet.Prefs.IPreferences.IV
set

IV for the obfuscated data.

Implemented in BogaNet.Prefs.Preferences.

◆ Keys

List<string> BogaNet.Prefs.IPreferences.Keys
get

Current keys of the preferences.

Implemented in BogaNet.Prefs.Preferences.


The documentation for this interface was generated from the following file: