BogaNet 1.4.0
Loading...
Searching...
No Matches
Public Member Functions | Events | List of all members
BogaNet.Prefs.BrowserPreferencesContainer Class Reference

Container for preferences in Avalonia (browser). More...

Inheritance diagram for BogaNet.Prefs.BrowserPreferencesContainer:
BogaNet.Prefs.PreferencesContainer BogaNet.Prefs.IPreferencesContainer

Public Member Functions

 BrowserPreferencesContainer ()
 
override bool Load (string filepath="")
 Load the preference file.
 
override Task< bool > LoadAsync (string filepath="")
 Load the preference file asynchronously.
 
override bool Save (string filepath="")
 Save the preference file.
 
override Task< bool > SaveAsync (string filepath="")
 Save the preference file asynchronously.
 
override bool Delete (string filepath="")
 Delete all preferences, including the file.
 
- Public Member Functions inherited from BogaNet.Prefs.PreferencesContainer
virtual bool Remove (string key)
 Removes a key/value from the preferences.
 
virtual bool ContainsKey (string key)
 Checks if a given key exists in the preferences.
 
virtual object Get (string key, bool obfuscated=false)
 Get an object for a key.
 
virtual bool TryGet (string key, out object result, bool obfuscated=false)
 Tries to get an object for a key.
 
virtual void Set (string key, object value, bool obfuscated=false)
 Set an object for a key.
 
override string ToString ()
 

Events

new IFilePreferences.? FileLoaded OnFileLoaded
 
new IFilePreferences.? FileSaved OnFileSaved
 
- Events inherited from BogaNet.Prefs.PreferencesContainer
IFilePreferences.? FileLoaded OnFileLoaded
 
IFilePreferences.? FileSaved OnFileSaved
 

Additional Inherited Members

- Protected Attributes inherited from BogaNet.Prefs.PreferencesContainer
string _file = "BNPrefs.json"
 
Dictionary< string, object > _preferences = []
 
- Properties inherited from BogaNet.Prefs.PreferencesContainer
virtual ByteObf IV = 139 [set]
 IV for the obfuscated data.
 
virtual bool IsLoaded [get, protected set]
 Is the preferences-container loaded?
 
virtual bool IsSaved [get, protected set]
 Is the current preferences-container saved?
 
virtual List< string > Keys [get]
 Current keys of the preferences.
 
virtual int Count [get]
 Current count of keys from the preferences.
 
- Properties inherited from BogaNet.Prefs.IPreferencesContainer

Detailed Description

Container for preferences in Avalonia (browser).

Constructor & Destructor Documentation

◆ BrowserPreferencesContainer()

BogaNet.Prefs.BrowserPreferencesContainer.BrowserPreferencesContainer ( )

Member Function Documentation

◆ Delete()

override bool BogaNet.Prefs.BrowserPreferencesContainer.Delete ( string filepath = "")
virtual

Delete all preferences, including the file.

Parameters
filepathPreference file to delete

returns>True if the operation was successful

Exceptions
Exception

Reimplemented from BogaNet.Prefs.PreferencesContainer.

◆ Load()

override bool BogaNet.Prefs.BrowserPreferencesContainer.Load ( string filepath = "")
virtual

Load the preference file.

Parameters
filepathPreference file to load

returns>True if the operation was successful

Exceptions
Exception

Reimplemented from BogaNet.Prefs.PreferencesContainer.

◆ LoadAsync()

override Task< bool > BogaNet.Prefs.BrowserPreferencesContainer.LoadAsync ( string filepath = "")
virtual

Load the preference file asynchronously.

Parameters
filepathPreference file to load

returns>True if the operation was successful

Exceptions
Exception

Reimplemented from BogaNet.Prefs.PreferencesContainer.

◆ Save()

override bool BogaNet.Prefs.BrowserPreferencesContainer.Save ( string filepath = "")
virtual

Save the preference file.

Parameters
filepathPreference file to save

returns>True if the operation was successful

Exceptions
Exception

Reimplemented from BogaNet.Prefs.PreferencesContainer.

◆ SaveAsync()

override Task< bool > BogaNet.Prefs.BrowserPreferencesContainer.SaveAsync ( string filepath = "")
virtual

Save the preference file asynchronously.

Parameters
filepathPreference file to save

returns>True if the operation was successful

Exceptions
Exception

Reimplemented from BogaNet.Prefs.PreferencesContainer.

Event Documentation

◆ OnFileLoaded

new IFilePreferences.? FileLoaded BogaNet.Prefs.BrowserPreferencesContainer.OnFileLoaded

◆ OnFileSaved

new IFilePreferences.? FileSaved BogaNet.Prefs.BrowserPreferencesContainer.OnFileSaved

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