private async void buttonLogin_Click(object sender, EventArgs e)
        {
            buttonLogin.Enabled = false;

            try
            {
                _cancellationTokenSource = new CancellationTokenSource();
                _userCredentials = await GoogleBloggerv3Client.GetOAuth2AuthorizationAsync(_blogId, _cancellationTokenSource.Token);
                _cancellationTokenSource = null;

                if (_userCredentials?.Token != null)
                {
                    // Leave the button disabled but let the user know they are signed in.
                    buttonLogin.Text = Res.Get(StringId.CWGoogleBloggerSignInSuccess);

                    // If this is the first time through the login flow, automatically click the 'Next' button on 
                    // behalf of the user.
                    if (_wizardController != null)
                    {
                        _wizardController.next();
                        _wizardController = null;
                    }
                }
            }
            finally
            {
                if (_userCredentials?.Token == null)
                {
                    // Let the user try again.
                    buttonLogin.Enabled = true;
                }
            }
        }
        public WizardSharePointAutoDetectionStep(
            IBlogClientUIContext uiContext,
            TemporaryBlogSettings temporarySettings,
            WizardController.NextCallback nextHandler,
            IWizardAutoDetectionOperation autoDetectionOperation)

            : base(uiContext, temporarySettings, nextHandler, autoDetectionOperation)
        {
        }
        public WeblogConfigurationWizardPanelGoogleBloggerAuthentication(string blogId, WizardController wizardController)
        {
            _blogId = blogId;
            _wizardController = wizardController;

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            
            labelHeader.Text = Res.Get(StringId.CWGoogleBloggerTitle);
            labelDescription.Text = Res.Get(StringId.CWGoogleBloggerDescription);
            buttonLogin.Text = Res.Get(StringId.Login);
        }
        public WizardAutoDetectionStep(
            IBlogClientUIContext uiContext,
            TemporaryBlogSettings temporarySettings,
            WizardController.NextCallback nextHandler,
            IWizardAutoDetectionOperation autoDetectionOperation)

            : base(new WeblogConfigurationWizardPanelAutoDetection(),
                    StringId.ConfigWizardDetectSettings,
                    null, null, nextHandler, null, null)
        {
            _uiContext = uiContext;
            _temporarySettings = temporarySettings;
            _autoDetectionOperation = autoDetectionOperation;
        }
Esempio n. 5
0
        public WizardForm(WizardController controller)
        {
            _controller = controller;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            buttonBack.Text = Res.Get(StringId.WizardBack);
            buttonNext.Text = BUTTON_TEXT_NEXT;
            buttonCancel.Text = Res.Get(StringId.CancelButton);
            _controller.WizardControl = this;

            this.FormClosing += new FormClosingEventHandler(WizardForm_FormClosing);
        }
        public void Start(IProgressProvider progressProvider, WizardController wizard)
        {
            // save reference
            _progressProvider = progressProvider;

            // reset the progress UR and start the animiation
            labelProgress.Text = String.Empty;
            progressBar.Value = 0;
            progressAnimatedBitmap.Start();

            // subscribe to progress events
            _progressProvider.ProgressUpdated += new ProgressUpdatedEventHandler(_progressProvider_ProgressUpdated);

            // focus the back button
            BeginInvoke(new InvokeInUIThreadDelegate(wizard.FocusBackButton));
        }
        public WeblogConfigurationWizard(WizardController controller) : base(controller)
        {
            this.BackColor = SystemColors.Window;
            this.ForeColor = SystemInformation.HighContrast ? SystemColors.WindowText : Color.FromArgb(51, 51, 51);
            this.ClientSize = new System.Drawing.Size(440, 348);
            this.Text = Res.Get(StringId.CWTitle);
            this.Icon = ApplicationEnvironment.ProductIcon;
            this.SizeChanged += new EventHandler(WeblogConfigurationWizard_SizeChanged);

            this.Height = Res.WizardHeight;

            proxyLabel = new LinkLabel();
            proxyLabel.Text = Res.Get(StringId.EditProxySettings);
            proxyLabel.AutoSize = true;
            proxyLabel.Location = new Point(19, 16);
            proxyLabel.LinkBehavior = LinkBehavior.HoverUnderline;
            proxyLabel.Name = "linkLabelProxy";
            proxyLabel.LinkColor = SystemInformation.HighContrast ? SystemColors.HotTrack : Color.FromArgb(0, 102, 204);
            proxyLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(proxyLabel_LinkClicked);
            panelFooter.Controls.Add(proxyLabel);
            proxyLabel.Visible = false;
            proxyLabel.TabIndex = 0;
        }
 public WizardSubStep(UserControl control, StringId? header, WizardController.DisplayCallback display, WizardController.VerifyStepCallback verify, WizardController.NextCallback next, WizardController.NextCallback undoNext, WizardController.BackCallback back) :
     base(control, header, display, verify, next, undoNext, back)
 {
 }
 /// <summary>
 /// Creates a new Wizard step.
 /// </summary>
 /// <param name="header">The image and label header to assign this step</param>
 /// <param name="control">The control to display when this step is activated.</param>
 /// <param name="verify">A verification callback that will be triggered prior to advancing
 /// past this step. If this callback returns false, the step will not advance.</param>
 /// <param name="next">A callback that will be triggered after the step has been verified
 /// and just before advancing to the next step. Steps can use this callback to add additional
 /// substeps prior to moving past this step.</param>
 /// <param name="back">A callback that will be triggered when the Wizard is going back one step.
 /// WizardSteps can use this callback to rollback any stateful side effects that may have occurred
 /// as a result of previously executing this step.</param>
 public WizardStep(UserControl control, StringId? header, WizardController.DisplayCallback display, WizardController.VerifyStepCallback verify, WizardController.NextCallback next, WizardController.NextCallback undoNext, WizardController.BackCallback back)
 {
     Control = control;
     Header = header;
     DisplayHandler = display;
     VerifyHandler = verify;
     NextHandler = next;
     UndoNextHandler = undoNext;
     BackHandler = back;
 }