コード例 #1
0
ファイル: Profile.cs プロジェクト: diminovei/FlexRouter
        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);
        }
コード例 #2
0
        private void OnDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ProfileEditor profileEditor
                = new ProfileEditor(txtBlock.Text);

            profileEditor.ShowDialog();

            txtBlock.Text = profileEditor.ChangedName;
        }
コード例 #3
0
        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;
        }