public static User Map(ParseUser puser) { User user = new User(); user.UserName = puser.Username; user.ObjectId = puser.ObjectId; user.Email = puser.Email; return user; }
public AddExpedition(ExpeditionFormType formType, User user) { InitializeComponent(); _user = user; if (formType == ExpeditionFormType.Add) { this.Text = "Add Expedition"; } else { this.Text = "Edit Expedition"; } }
// events private async void EliteExplorer_Load(object sender, EventArgs e) { if (ParseUser.CurrentUser != null) { // do stuff with the user _user = UserMapper.Map(ParseUser.CurrentUser); } else { // show the signup or login screen if (!ConfigurationManager.AppSettings.HasKeys()) { // TODO: Form Popup to signup ConfigurationManager.AppSettings.Add("commander", "The Mule"); } else { // TODO: Login screen popup var login = new Login(); var a = true; while (a) if (login.ShowDialog() == DialogResult.OK) { var commander = login.UsernameText; var pass = login.PasswordText; try { await ParseUser.LogInAsync(commander, pass); // Login was successful. a = !a; } catch (Exception ex) { // The login failed. Check the error to see why. MessageBox.Show(ex.Message); } } } } _persistentStore = new ParsePersistentStore(_user); _watcher = new NetLogWatcher(_persistentStore); _watcher.Watcher.Path = @"C:\Users\John Goode\AppData\Local\Frontier_Developments\Products\FORC-FDEV-D-1003\Logs"; // C:\Users\John Goode\AppData\Local\Frontier_Developments\Products\FORC-FDEV-D-1003\Logs _watcher.OnNewPosition += new NetLogWatcherHandler(this.NewPosition); //_watcher.SystemFound += _watcher_SystemFound; _watcher.Start(); }