public static string CreateNewProfile(bool disablePrivateProfile) { var profileList = GetProfileList(ProfileItemPrivacyType.Public.ToString()); loop: var it = new ProfileEditor(); if (it.ShowDialog() != true) { return(null); } var profileName = it.GetProfileName(); var mainProcessName = it.GetMainProcessName(); if (profileList.ContainsKey(profileName)) { MessageBox.Show(LanguageManager.GetPhrase(Phrases.SettingsMessageProfileNameIsAlreadyExist), LanguageManager.GetPhrase(Phrases.MessageBoxErrorHeader), MessageBoxButton.OK, MessageBoxImage.Error); goto loop; } Clear(); _currentProfileName = profileName; _mainSimulatorProcess = mainProcessName; _currentProfilePath = GenerateProfileFileName(); _currentPersonalProfilePath = _currentProfilePath.Replace(@"\" + ProfileFolder + @"\", @"\" + ProfileAssignmentsFolder + @"\") + "p"; _currentProfileId = GlobalId.GetNew(); Save(disablePrivateProfile); return(profileName); }
private void OnDoubleClick(object sender, MouseButtonEventArgs e) { ProfileEditor profileEditor = new ProfileEditor(txtBlock.Text); profileEditor.ShowDialog(); txtBlock.Text = profileEditor.ChangedName; }
private void EditProfile_OnClick(object sender, RoutedEventArgs e) { ProfileEditor profileEditor = new ProfileEditor(user); profileEditor.ShowDialog(); user = profileEditor.UpdatedUser; UsernameText.Text = user.Username; PasswordText.Text = user.Password; EmailText.Text = user.EmailAddress; }