コード例 #1
0
 private void UserSettings_Click(object sender, RoutedEventArgs e)
 {
     if (!Vars.IsAdmin)
     {
         SettingsUser userSettings = new SettingsUser();
         userSettings.ShowDialog();
     }
 }
コード例 #2
0
        void RememberPassword()
        {
            Action Remember = () =>
            {
                var us = users.Where(u => u.UserName == this.UserName);
                if (this.IsRemember)
                {
                    if (us.Count() > 0)
                    {
                        SettingsUser user = us.FirstOrDefault();
                        if (user.Password == this.Password)
                        {
                            return;
                        }

                        users.Remove(user);
                        users.Add(new SettingsUser(this.UserName, this.Password));
                    }
                    else
                    {
                        users.Add(new SettingsUser(this.UserName, this.Password));
                    }
                }
                else if (us.Count() > 0)
                {
                    users.Remove(us.FirstOrDefault());
                }
                SettingsUsers urs = new SettingsUsers(users);
                Settings.Default.Users = urs;
                Settings.Default.Save();
            };

            Remember.BeginInvoke(ar =>
            {
                Remember.EndInvoke(ar as IAsyncResult);
            }, Remember);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: IldarProgrammist/CryptaRSA
 public Form1()
 {
     InitializeComponent();
     _settingsUser = SettingsUser.GetSettingsUser();
     _initControlls();
 }