public App() { InitializeComponent(); if (_isLoggedIn = File.Exists(_fileName)) { user = JsonConvert.DeserializeObject <API.User>(File.ReadAllText(_fileName, Encoding.UTF8)); MainPage = new NavigationPage(new ScheduleView()); } else { MainPage = new NavigationPage(new MainPage()); } }
protected override void OnAppearing() { base.OnAppearing(); if (App._isLoggedIn) { user = App.user; Role.SelectedIndex = user.Info == API.User.UserInfo.teacher ? 1 : 0; List_NmOrGr.SelectedIndex = user.list1selID; if (user.Info != API.User.UserInfo.teacher) { List_Groups.SelectedIndex = user.list2selID; } App._isLoggedIn = false; File.Delete(App._fileName); App.user = new API.User(); } }
internal void Update(ClientState state, API.User recipient) { Recipient.Update(state, recipient); }
internal static SocketDMChannel Create(DiscordSocketClient discord, ClientState state, ulong channelId, API.User recipient) { var entity = new SocketDMChannel(discord, channelId, discord.GetOrCreateTemporaryUser(state, recipient)); entity.Update(state, recipient); return(entity); }
public AuthController() { _security = new Security(); _user = new User(); }