private void ButtonSetTarget_Click(object sender, RoutedEventArgs e)
        {
            this.cbTarget.SelectedValue = null;
            var dataContext = this.DataContext as PublishProfileEditorResources;

            if (dataContext == null)
            {
                throw new InvalidOperationException("DataContext is not a valid PublishProfileEditorResources");
            }

            var loginForm = new LogOnForm(Application.Current.MainWindow);

            var result = loginForm.ShowDialog();

            if (result == true)
            {
                var target = loginForm.CloudTarget;

                dataContext.LoggedIn = true;

                dataContext.SelectedPublishProfile.User     = loginForm.Credentials.User;
                dataContext.SelectedPublishProfile.Password = loginForm.Credentials.Password;
                this.cbTarget.SelectedValue = target;
            }
        }
示例#2
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     m_bIsLogIn  = false;
     m_LoginForm = new LogOnForm(Connect, Reconnect);
     m_LoginForm.ShowDialog();
     if (m_bIsLogIn == false)
     {
         Close();
     }
 }
示例#3
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     this.DisableUI();
     try
     {
         using (LogOnForm f = new LogOnForm())
         {
             f.ManagerFactory = this.currentManagerFactory;
             f.ShowDialog();
             this.currentUserToken = f.UserIdToken;
         }
     }
     finally
     {
         this.RefreshActivationStorageInformation();
         this.RefreshLogOnInformation();
         this.RefreshUI();
     }
 }
示例#4
0
        private void ButtonSetTarget_Click(object sender, RoutedEventArgs e)
        {
            var dataContext = this.DataContext as PublishProfileEditorResources;

            if (dataContext == null)
            {
                throw new InvalidOperationException("DataContext is not a valid PublishProfileEditorResources");
            }

            var loginForm = new LogOnForm();

            var result = loginForm.ShowDialog();

            if (result == true)
            {
                var target = loginForm.CloudTarget;
                this.cbTarget.SelectedValue = target;
            }
        }
示例#5
0
        private void AddTargetButton_Click(object sender, RoutedEventArgs e)
        {
            var loginForm = new LogOnForm();

            var result = loginForm.ShowDialog();

            if (result == true)
            {
                var target = loginForm.CloudTarget;

                if (target != null)
                {
                    CloudTargetManager.SaveTarget(target);
                    CloudCredentialsManager.Save(target.TargetUrl, target.Email, loginForm.Credentials.Password);

                    this.ReloadTargets();
                }
            }
        }