Beispiel #1
0
        void ClientLogic_ClientLogicSetupWizardPrompt(object sender, ClientLogicSetupWizardPromptEventArgs e)
        {
            if (this.Dispatcher.CheckAccess())
            {
                if (e.Prompt == ClientLogicSetupWizardPromptOperation.ReportingUpdated)
                {
                    if (e.Succeeded)
                    {
                        DoRaiseExitWizard(true);
                    }
                    else
                    {
                        Mouse.OverrideCursor = null;

                        StackHashMessageBox.Show(Window.GetWindow(this),
                                                 Properties.Resources.SetupWizard_UpdateReportingStateFailedMBMessage,
                                                 Properties.Resources.SetupWizard_UpdateReportingStateFailedMBTitle,
                                                 StackHashMessageBoxType.Ok,
                                                 StackHashMessageBoxIcon.Error,
                                                 e.LastException,
                                                 e.LastServiceError);
                    }
                }
            }
            else
            {
                this.Dispatcher.BeginInvoke(new Action <object, ClientLogicSetupWizardPromptEventArgs>(ClientLogic_ClientLogicSetupWizardPrompt),
                                            sender, e);
            }
        }
Beispiel #2
0
        private void ClientLogic_ClientLogicSetupWizardPrompt(object sender, ClientLogicSetupWizardPromptEventArgs e)
        {
            if (this.Dispatcher.CheckAccess())
            {
                if (e.Prompt == ClientLogicSetupWizardPromptOperation.ProductListUpdated)
                {
                    listViewProducts.ItemsSource = this.ClientLogic.Products;

                    if (!e.Succeeded)
                    {
                        Mouse.OverrideCursor = null;

                        StackHashMessageBox.Show(Window.GetWindow(this),
                                                 Properties.Resources.SetupWizard_UpdateProductListFailedMBMessage,
                                                 Properties.Resources.SetupWizard_UpdateProductListFailedMBTitle,
                                                 StackHashMessageBoxType.Ok,
                                                 StackHashMessageBoxIcon.Error,
                                                 e.LastException,
                                                 e.LastServiceError);
                    }
                }
            }
            else
            {
                this.Dispatcher.BeginInvoke(new Action <object, ClientLogicSetupWizardPromptEventArgs>(ClientLogic_ClientLogicSetupWizardPrompt),
                                            sender, e);
            }
        }
Beispiel #3
0
        private void ClientLogic_ClientLogicSetupWizardPrompt(object sender, ClientLogicSetupWizardPromptEventArgs e)
        {
            if (this.Dispatcher.CheckAccess())
            {
                switch (e.Prompt)
                {
                case ClientLogicSetupWizardPromptOperation.AdminServiceConnect:
                    if (e.Succeeded)
                    {
                        // save service proxy settings
                        UpdatateServiceProxySettings();
                    }
                    else
                    {
                        Mouse.OverrideCursor = null;

                        StackHashMessageBox.Show(Window.GetWindow(this),
                                                 Properties.Resources.SetupWizard_ServiceConnectFailedMBMessage,
                                                 Properties.Resources.SetupWizard_ServiceConnectFailedMBTitle,
                                                 StackHashMessageBoxType.Ok,
                                                 StackHashMessageBoxIcon.Error,
                                                 e.LastException,
                                                 e.LastServiceError);
                    }
                    break;

                case ClientLogicSetupWizardPromptOperation.ProxySettingsUpdated:
                    if (e.Succeeded)
                    {
                        UserSettings.Settings.ServiceHost = _host;
                        UserSettings.Settings.ServicePort = _port;

                        // go to the next page
                        if (((this.ClientLogic.ContextCollection != null) && (this.ClientLogic.ContextCollection.Count > 0)) ||
                            (!this.ClientLogic.ServiceIsLocal))
                        {
                            // profiles exist or we're not on the service computer so the wizard should just select a profile
                            DoRaiseConfigureForProfileOnly();
                            DoRaiseShowNextPage();
                        }
                        else
                        {
                            // we're on the service computer and there are no profiles so continue with normal setup
                            DoRaiseConfigureForInitialSetup();
                            DoRaiseShowNextPage();
                        }
                    }
                    else
                    {
                        Mouse.OverrideCursor = null;

                        StackHashMessageBox.Show(Window.GetWindow(this),
                                                 Properties.Resources.SetupWizard_ProxyUpdateFailedMBMessage,
                                                 Properties.Resources.SetupWizard_ProxyUpdateFailedMBTitle,
                                                 StackHashMessageBoxType.Ok,
                                                 StackHashMessageBoxIcon.Error,
                                                 e.LastException,
                                                 e.LastServiceError);
                    }
                    break;
                }
            }
            else
            {
                this.Dispatcher.BeginInvoke(new Action <object, ClientLogicSetupWizardPromptEventArgs>(ClientLogic_ClientLogicSetupWizardPrompt),
                                            sender, e);
            }
        }
Beispiel #4
0
        private void ClientLogic_ClientLogicSetupWizardPrompt(object sender, ClientLogicSetupWizardPromptEventArgs e)
        {
            if (this.Dispatcher.CheckAccess())
            {
                switch (e.Prompt)
                {
                case ClientLogicSetupWizardPromptOperation.FirstContextCreated:
                    if (e.Succeeded)
                    {
                        // test the provided WinQual Credentials
                        this.ClientLogic.AdminTestWinQualLogOn(UserSettings.Settings.CurrentContextId, _username, _password);
                    }
                    else
                    {
                        Mouse.OverrideCursor = null;

                        StackHashMessageBox.Show(Window.GetWindow(this),
                                                 Properties.Resources.SetupWizard_AddContextFailedMBMessage,
                                                 Properties.Resources.SetupWizard_AddContextFailedMBTitle,
                                                 StackHashMessageBoxType.Ok,
                                                 StackHashMessageBoxIcon.Error,
                                                 e.LastException,
                                                 e.LastServiceError);
                    }
                    break;

                case ClientLogicSetupWizardPromptOperation.LogOnTestComplete:
                    if (e.Succeeded)
                    {
                        // sync with WinQual to get the product list
                        this.DisableWizard = true;     // force diable as the client won't stay busy during the sync
                        this.ClientLogic.AdminStartSync(false, true, true, null);
                    }
                    else
                    {
                        Mouse.OverrideCursor = null;

                        StackHashMessageBox.Show(Window.GetWindow(this),
                                                 Properties.Resources.SetupWizard_LogOnTestFailedMBMessage,
                                                 Properties.Resources.SetupWizard_LogOnTestFailedMBTitle,
                                                 StackHashMessageBoxType.Ok,
                                                 StackHashMessageBoxIcon.Error,
                                                 e.LastException,
                                                 e.LastServiceError);
                    }
                    break;

                case ClientLogicSetupWizardPromptOperation.ProductListUpdated:
                    // always enable the wizard again when the sync completes
                    this.DisableWizard = false;

                    if (e.Succeeded)
                    {
                        // we have the product list, can go to the next page
                        this.DoRaiseShowNextPage();
                    }
                    else
                    {
                        Mouse.OverrideCursor = null;

                        StackHashMessageBox.Show(Window.GetWindow(this),
                                                 Properties.Resources.SetupWizard_GetProductListFailedMBMessage,
                                                 Properties.Resources.SetupWizard_GetProductListFailedMBTitle,
                                                 StackHashMessageBoxType.Ok,
                                                 StackHashMessageBoxIcon.Error,
                                                 e.LastException,
                                                 e.LastServiceError);
                    }
                    break;

                case ClientLogicSetupWizardPromptOperation.SyncFailed:
                    // always enable the wizard again when the sync fails
                    this.DisableWizard = false;

                    // report the error
                    Mouse.OverrideCursor = null;
                    StackHashMessageBox.Show(Window.GetWindow(this),
                                             Properties.Resources.Error_SyncFailedMBMessage,
                                             Properties.Resources.Error_SyncFailedMBTitle,
                                             StackHashMessageBoxType.Ok,
                                             StackHashMessageBoxIcon.Error,
                                             e.LastException,
                                             e.LastServiceError);
                    break;
                }
            }
            else
            {
                this.Dispatcher.BeginInvoke(new Action <object, ClientLogicSetupWizardPromptEventArgs>(ClientLogic_ClientLogicSetupWizardPrompt),
                                            sender, e);
            }
        }