BGC Tools
|
Static Public Member Functions | |
static void | Save () |
Serialize the current user's data More... | |
static bool | HasKey (string key) |
static void | RemoveKey (string key) |
static void | SetInt (string key, int value) |
static void | SetBool (string key, bool value) |
static void | SetString (string key, string value) |
static void | SetFloat (string key, float value) |
static void | SetDouble (string key, double value) |
static void | SetJsonValue (string key, JsonValue value) |
static void | SetJsonArray (string key, JsonArray value) |
static int | GetInt (string key, int defaultReturn=0) |
static bool | GetBool (string key, bool defaultReturn=false) |
static string | GetString (string key, string defaultReturn="") |
static float | GetFloat (string key, float defaultReturn=0f) |
static double | GetDouble (string key, double defaultReturn=0.0) |
static JsonValue | GetJsonValue (string key, JsonValue defaultReturn=default(JsonValue)) |
static JsonArray | GetJsonArray (string key, JsonArray defaultReturn=default(JsonArray)) |
static void | DeserializeUsers () |
Load all usernames More... | |
static IEnumerable< string > | GetUserNames () |
Returns an enumeration of all loaded usernames More... | |
static bool | UserExists (string userName) |
Does the requested user already exist? More... | |
static bool | LogIn (string userName, Action userChangingCallback=null) |
Attempts to log in with userName More... | |
static void | LogOut () |
Save and clear the current user More... | |
static bool | AddUser (string userName) |
Add a new user. More... | |
static void | DeleteUserData (string userName) |
Deserialize, delete, and remove a user More... | |
static IEnumerable< MigrationData > | GetMigrationData (string pushLogsKey, string organizationKey, string studyKey) |
Get the migration preferences of all profiles. More... | |
Data Fields | |
const string | UserDataDir = "SaveData" |
Static Public Attributes | |
static DefaultData | DefaultData => _defaultData ?? (_defaultData = new DefaultData()) |
The default profile data. More... | |
static ProfileData | ProfileData => _currentUserData as ProfileData ?? DefaultData |
Profile Data of the current user. Or default if none are logged in. More... | |
static string | UserName => ProfileData.UserName |
The Current Profile UserName More... | |
static bool | IsDefault => ProfileData.IsDefault |
The Current Profile IsDefault Status More... | |
Properties | |
static bool | IsLocked [get, set] |
Is the device currently in a Locked mode? More... | |
static bool | EverUnlocked [get, set] |
Has the device ever been unlocked? More... | |
Private Attributes | |
const string | LockStateKey = "LockState" |
const string | EverUnlockedKey = "EverUnlocked" |
Static Private Attributes | |
static DefaultData | _defaultData = null |
static UserData | _currentUserData = null |
static bool | initialized = false |
static string | previousUser = "" |
static readonly List< string > | users = new List<string>() |
Definition at line 11 of file PlayerData.cs.
|
inlinestatic |
Add a new user.
Definition at line 167 of file PlayerData.cs.
References BGC.Users.ProfileData.Serialize().
|
inlinestatic |
Deserialize, delete, and remove a user
Definition at line 189 of file PlayerData.cs.
References BGC.Users.ProfileData.DeletePlayerData(), and BGC.Users.ProfileData.Deserialize().
|
inlinestatic |
Load all usernames
Definition at line 98 of file PlayerData.cs.
References BGC.IO.DataManagement.GetDataFiles(), and BGC.IO.FileExtensions.JSON.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
Get the migration preferences of all profiles.
Definition at line 201 of file PlayerData.cs.
References BGC.Users.ProfileData.Deserialize(), BGC.Users.ProfileData.GetBool(), BGC.Users.ProfileData.GetString(), and BGC.Users.ProfileData.UserName.
|
static |
|
static |
Returns an enumeration of all loaded usernames
|
static |
|
inlinestatic |
Attempts to log in with userName
userName | Name of user to log into |
userChangingCallback | Optional callback invoked when the user will change. Typically clearing logs, for example. |
Definition at line 132 of file PlayerData.cs.
References BGC.Users.ProfileData.Deserialize().
|
inlinestatic |
|
static |
|
static |
Serialize the current user's data
Referenced by BGC.Study.ProtocolManager.ExecuteNextElement().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Does the requested user already exist?
|
staticprivate |
Definition at line 19 of file PlayerData.cs.
|
staticprivate |
Definition at line 15 of file PlayerData.cs.
|
static |
The default profile data.
Definition at line 17 of file PlayerData.cs.
|
private |
Definition at line 32 of file PlayerData.cs.
|
staticprivate |
Definition at line 24 of file PlayerData.cs.
|
static |
The Current Profile IsDefault Status
Definition at line 71 of file PlayerData.cs.
|
private |
Definition at line 31 of file PlayerData.cs.
|
staticprivate |
Definition at line 26 of file PlayerData.cs.
|
static |
Profile Data of the current user. Or default if none are logged in.
Definition at line 21 of file PlayerData.cs.
const string BGC.Users.PlayerData.UserDataDir = "SaveData" |
Definition at line 13 of file PlayerData.cs.
|
static |
The Current Profile UserName
Definition at line 69 of file PlayerData.cs.
|
staticprivate |
Definition at line 28 of file PlayerData.cs.
|
staticgetset |
Has the device ever been unlocked?
Definition at line 54 of file PlayerData.cs.
|
staticgetset |
Is the device currently in a Locked mode?
Definition at line 36 of file PlayerData.cs.