/** * Añade un nuevo perfil a la aplicacion */ private void addProfile(object sender, RoutedEventArgs e) { NewProfile newProf = new NewProfile(); newProf.ShowDialog(); if (newProf.isAdded()) { Button b = new Button(); b.Content = newProf.getName(); b.HorizontalAlignment = HorizontalAlignment.Stretch; b.VerticalAlignment = VerticalAlignment.Stretch; b.VerticalContentAlignment = VerticalAlignment.Center; b.HorizontalContentAlignment = HorizontalAlignment.Stretch; b.FontSize = 40; b.Padding = new Thickness(0); b.Foreground = new SolidColorBrush(Color.FromRgb(255, 255, 255)); b.Style = Application.Current.Resources["CustomButtonStyle"] as Style; b.Click += selectProfile; Lista.addButtonProfile(b); perfiles.Children.Add(b); MessageBox.Show("El perfil ha sido creado. Cambia al perfil desde el panel de opciones pulsando \"Cambiar Perfil\""); } else { MessageBox.Show("No se ha podido crear el perfil"); } }
private void btnNewProfile_Click(object sender, RoutedEventArgs e) { this.Hide(); NewProfile newProfile = new NewProfile(); newProfile.ShowDialog(); }
private void cmdNew_Click(object sender, EventArgs e) { try { DatabaseProfile dbProfile = new DatabaseProfile(string.Format("New")); RenameProfile: NewProfile frmAddProfile = new NewProfile(dbProfile.Name); if (DialogResult.OK == frmAddProfile.ShowDialog()) { dbProfile.Name = frmAddProfile.ProfileName; if (_dbSettings.Profiles[dbProfile.Name] != null) { MessageBox.Show("The profile you entered already exists. Choose a different name for the profile."); goto RenameProfile; } ProfileSetup newProfile = new ProfileSetup(dbProfile); if (newProfile.ShowDialog() == DialogResult.OK) { _dbSettings.Profiles.Add(dbProfile); ShowProfiles(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Add profile"); } }
//Enter clicked on keyboard. private void enterClicked(object sender, EventArgs e) { // Get new profile script on game object and start creating a new profile. GameObject profile = GameObject.Find("Menu"); NewProfile script = profile.GetComponent <NewProfile>(); Debug.Log($"Username in keybored text: {GetComponent<TMP_InputField>().text}"); script.createNewProfile(); }
// Get the menu so we can adjust the status text to prompt the user. IEnumerator getMenu() { // Delay to give time for the menu to load. Debug.Log("Wating"); yield return(new WaitForSeconds(0.500F)); //Find the menu, get the profile script and use the setStatus script to amend text. GameObject profile = GameObject.Find("Menu"); NewProfile script = profile.GetComponent <NewProfile>(); script.setStatus("Please select a user", Color.red); }
public ActionResult Edit(NewProfile editProf) { if (ModelState.IsValid) { Person persondetails = db.People.Find(User.Identity.Name); if (persondetails != null) { persondetails.fullName = editProf.fullName; persondetails.email = editProf.emailID; persondetails.active = editProf.active; db.Entry(persondetails).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Details")); } } return(View(editProf)); }
public ActionResult Edit() { if (User.Identity.Name == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Person person = db.People.Find(User.Identity.Name); if (person == null) { return(HttpNotFound()); } NewProfile editprof = new NewProfile(); editprof.fullName = person.fullName; editprof.emailID = person.email; editprof.active = person.active; return(View(editprof)); }
public ActionResult Details() { if (User.Identity.Name == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Person person = db.People.Find(User.Identity.Name); if (person == null) { return(HttpNotFound()); } NewProfile ep = new NewProfile(); ep.active = person.active; ep.emailID = person.email; ep.fullName = person.fullName; ep.Joined = person.joined; return(View(ep)); }
private void OnNewProfile(NewProfile msg) { AllProfiles.Add(msg.Profile.Name); }
private void OnNewProfile(NewProfile message) { Profiles.Add(message.Profile.Name); }