public LoggedAs(MainWindow mainWindow, UserSaveInfo root) { InitializeComponent(); main = mainWindow; userName.Text = "Currently is logged in " + root.UserName; save = root; }
public bool LoadSavedData() { if (!File.Exists("user.json")) { return(false); } try { string text = File.ReadAllText("user.json"); userInfo = JsonConvert.DeserializeObject <UserSaveInfo>(text); } catch { MessageBox.Show("Nepodařilo se načíst data o uživateli!", "Pozor", MessageBoxButton.OK, MessageBoxImage.Warning); return(false); } return(true); }
static UserInformation() { CURRENT_USER_ID = new SuperInt(-1, "currentuser"); USERSAVEINFO = new UserSaveInfo("user"); USERSAVEINFO.Xuat(); DEVICESAVEINFO = new DeviceSaveInfo("gfv"); #if UNITY_EDITOR if (DEVICESAVEINFO.N.Get() <= 1) { DEVICESAVEINFO.AddDeviceInfo("1111111", "222222", "181d"); } string s = ""; //foreach (characteristicUUIDInfo i in LISTS_OBTAINED) { s += "aaaa" + "," + "bbbbb" + "," + "sdfsd f " + "\n"; s += "aaaa2" + "," + "bbbbb2" + "," + "sdfsd f " + "\n"; } DEVICESAVEINFO.DEVICES[0].INFO.STR = s; DEVICESAVEINFO.DEVICES[0].Save(); #endif }
public void ClearSavedData() { File.Delete("user.json"); userInfo = null; }