CmisSync.SetupController.SettingsPageCompleted C# (CSharp) Méthode

SettingsPageCompleted() public méthode

Repository settings page.
public SettingsPageCompleted ( string password, int pollInterval, bool syncAtStartup ) : void
password string
pollInterval int
syncAtStartup bool
Résultat void
        public void SettingsPageCompleted(string password, int pollInterval, bool syncAtStartup)
        {
            //Run this in background so as not to free the GUI...
            BackgroundWorker worker = new BackgroundWorker();
            worker.DoWork += new DoWorkEventHandler(
                delegate(Object o, DoWorkEventArgs args)
                {
                    Program.Controller.UpdateRepositorySettings(saved_repository, password, pollInterval, syncAtStartup);
                }
            );
            worker.RunWorkerAsync();

            FinishPageCompleted();
        }
    }

Usage Example

Exemple #1
0
        partial void OnSave(NSObject sender)
        {
            if (!String.IsNullOrEmpty(PasswordText.StringValue))
            {
                // Try to find the CMIS server and Check credentials
                var credentials = new ServerCredentials()
                {
                    UserName = UserText.StringValue,
                    Password = PasswordText.StringValue,
                    Address  = new Uri(AddressText.StringValue)
                };
                PasswordText.Enabled = false;
                CancelButton.Enabled = false;
                SaveButton.Enabled   = false;

                Thread check = new Thread(() => {
                    var fuzzyResult         = CmisUtils.GetRepositoriesFuzzy(credentials);
                    var cmisServer          = fuzzyResult.Item1;
                    Controller.repositories = (cmisServer != null)? cmisServer.Repositories: null;

                    InvokeOnMainThread(() => {
                        if (Controller.repositories == null)
                        {
                            string warning = "";
                            string message = fuzzyResult.Item2.Message;
                            Exception e    = fuzzyResult.Item2;
                            if (e is PermissionDeniedException)
                            {
                                warning = Properties_Resources.LoginFailedForbidden;
                            }
                            else if (e is ServerNotFoundException)
                            {
                                warning = Properties_Resources.ConnectFailure;
                            }
                            else if (e.Message == "SendFailure" && cmisServer.Url.Scheme.StartsWith("https"))
                            {
                                warning = Properties_Resources.SendFailureHttps;
                            }
                            else if (e.Message == "TrustFailure")
                            {
                                warning = Properties_Resources.TrustFailure;
                            }
                            else if (e.Message == "Unauthorized")
                            {
                                message = Properties_Resources.LoginFailedForbidden;
                            }
                            else
                            {
                                warning = Properties_Resources.Sorry;
                            }

                            NSAlert alert = NSAlert.WithMessage(message, "OK", null, null, warning);
                            alert.Icon    = new NSImage(System.IO.Path.Combine(NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-error.icns"));
                            alert.Window.OrderFrontRegardless();
                            alert.RunModal();

                            PasswordText.Enabled = true;
                            CancelButton.Enabled = true;
                            SaveButton.Enabled   = true;
                        }
                        else
                        {
                            RemoveEvent();
                            Controller.SettingsPageCompleted(PasswordText.StringValue, SliderIndexToPollingInterval(Slider.IntValue), (StartupCheckbox.State == NSCellStateValue.On));
                        }
                    });
                });
                check.Start();
            }
            else
            {
                Controller.SettingsPageCompleted(null, SliderIndexToPollingInterval(Slider.IntValue), (StartupCheckbox.State == NSCellStateValue.On));
            }
        }
All Usage Examples Of CmisSync.SetupController::SettingsPageCompleted