예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var userProfile = fProfile as UserProfile;

            string password = string.Empty;

            if (!InputDlg.QueryPassword(this, CommunicatorCore.APP_NAME, "Password", ref password))
            {
                return;
            }
            fCore.Identify(userProfile, password);

            userProfile.UserName  = txtUserName.Text;
            userProfile.Country   = txtCountry.Text;
            userProfile.TimeZone  = txtTimeZone.Text;
            userProfile.Languages = txtLanguages.Text;
            userProfile.Email     = txtEmail.Text;

            userProfile.IsCountryVisible   = chkCountryVisible.Checked;
            userProfile.IsTimeZoneVisible  = chkTimeZoneVisible.Checked;
            userProfile.IsLanguagesVisible = chkLanguagesVisible.Checked;
            userProfile.IsEmailVisible     = chkEmailVisible.Checked;

            fCore.Database.SaveProfile(userProfile);

            Close();
        }
예제 #2
0
 private void Authenticate()
 {
     if (fCore.Profile.IsIdentified)
     {
         string password = string.Empty;
         if (InputDlg.QueryPassword(this, CommunicatorCore.APP_NAME, "Password", ref password))
         {
             if (!fCore.Authenticate(password))
             {
                 MessageBox.Show("Authentication failed", CommunicatorCore.APP_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                 Close();
             }
         }
         else
         {
             Close();
         }
     }
     else
     {
         ShowProfile(fCore.Profile);
     }
 }