MVC controller for the two wizards: - CmisSync tutorial that appears at firt run, - wizard to add a new remote folder.
示例#1
0
        // Shared initialization code
        void Initialize()
        {
            Controller = new SetupController();

            Controller.ShowWindowEvent += delegate {
                InvokeOnMainThread(delegate {
                    Window.OrderFrontRegardless();
                });
            };

            Controller.HideWindowEvent += delegate {
                InvokeOnMainThread(delegate {
                    Window.PerformClose(this);
                });
            };

            Controller.ChangePageEvent += delegate(PageType type) {
                using (var a = new NSAutoreleasePool())
                {
                    InvokeOnMainThread(delegate {
                        if (!IsWindowLoaded)
                        {
                            LoadWindow();
                        }
                        switch (type)
                        {
                        case PageType.Setup:
                            ShowWelcomePage();
                            break;

                        case PageType.Tutorial:
                            ShowTutorialPage();
                            break;

                        case PageType.Add1:
                            ShowLoginPage();
                            break;

                        case PageType.Add2:
                            ShowRepoSelectPage();
                            break;

                        case PageType.Customize:
                            ShowCustomizePage();
                            break;

                        case PageType.Syncing:
                            ShowSyncingPage();
                            break;

                        case PageType.Finished:
                            ShowFinishedPage();
                            break;
                        }
                    });
                }
            };
        }
示例#2
0
        // Shared initialization code
        void Initialize ()
        {
            Controller = new SetupController ();

            Controller.ShowWindowEvent += delegate {
                InvokeOnMainThread (delegate {
                    Window.OrderFrontRegardless();
                });
            };

            Controller.HideWindowEvent += delegate {
                InvokeOnMainThread (delegate {
                    Window.PerformClose (this);
                });
            };

            Controller.ChangePageEvent += delegate (PageType type) {
                using (var a = new NSAutoreleasePool ())
                {
                    InvokeOnMainThread (delegate {
                        if (!IsWindowLoaded) {
                            LoadWindow();
                        }
                        switch (type)
                        {
                        case PageType.Setup:
                            ShowWelcomePage();
                            break;
                        case PageType.Tutorial:
                            ShowTutorialPage();
                            break;
                        case PageType.Add1:
                            ShowLoginPage();
                            break;
                        case PageType.Add2:
                            ShowRepoSelectPage();
                            break;
                        case PageType.Customize:
                            ShowCustomizePage();
                            break;
                        // case PageType.Syncing:
                        //    ShowSyncingPage();
                        //    break;
                        case PageType.Finished:
                            ShowFinishedPage();
                            break;
                        case PageType.Settings:
                            ShowSettingsPage();
                            break;
                        }
                    });
                }
            };
        }
        partial void OnContinue(MonoMac.Foundation.NSObject sender)
        {
            ServerCredentials credentials = new ServerCredentials()
            {
                UserName = UserText.StringValue,
                Password = PasswordText.StringValue,
                Address  = new Uri(AddressText.StringValue),
                Binding  = (this.Controller.saved_binding == null) ? ServerCredentials.BindingBrowser : this.Controller.saved_binding
            };

            WarnText.StringValue   = string.Empty;
            AddressText.Enabled    = false;
            UserText.Enabled       = false;
            PasswordText.Enabled   = false;
            ContinueButton.Enabled = false;
            CancelButton.Enabled   = false;
            //  monomac bug: animation GUI effect will cause GUI to hang, when backend thread is busy
//            LoginProgress.StartAnimation(this);
            Thread check = new Thread(() => {
                var result = SetupController.GetRepositories(credentials);
                if (result.Repositories != null)
                {
                    this.Controller.repositories = result.Repositories.WithoutHiddenOnce();
                }
                else
                {
                    this.Controller.repositories = null;
                }

                InvokeOnMainThread(delegate {
                    if (this.Controller.repositories == null)
                    {
                        AddressText.StringValue = result.Credentials.Address.ToString();
                        WarnText.StringValue    = this.Controller.GetConnectionsProblemWarning(result.FailedException);
                        AddressText.Enabled     = true;
                        UserText.Enabled        = true;
                        PasswordText.Enabled    = true;
                        ContinueButton.Enabled  = true;
                        CancelButton.Enabled    = true;
                    }
                    else
                    {
                        RemoveEvent();
                        Controller.Add1PageCompleted(result.Credentials.Address, result.Credentials.Binding, credentials.UserName, credentials.Password.ToString());
                    }

                    LoginProgress.StopAnimation(this);
                });
            });

            check.Start();
        }
示例#4
0
 // Call to load from the XIB/NIB file
 public SetupSubSettingController(SetupController controller) : base("SetupSubSetting", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize();
 }
 // Call to load from the XIB/NIB file
 public SetupSubLoginController (SetupController controller) : base ("SetupSubLogin", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize ();
 }
示例#6
0
 // Call to load from the XIB/NIB file
 public SetupSubWelcomeController(SetupController controller) : base("SetupSubWelcome", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize();
 }
 // Call to load from the XIB/NIB file
 public SetupSubRepoSelectController(SetupController controller) : base("SetupSubRepoSelect", NSBundle.MainBundle)
 {
     this.Controller = controller;
     this.Initialize();
 }
 // Call to load from the XIB/NIB file
 public SetupSubCustomizeController (SetupController controller) : base ("SetupSubCustomize", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize ();
 }
示例#9
0
 // Call to load from the XIB/NIB file
 public SetupSubTutorialBeginController(SetupController controller) : base("SetupSubTutorialBegin", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize();
 }
 // Call to load from the XIB/NIB file
 public SetupSubRepoSelectController(SetupController controller) : base("SetupSubRepoSelect", NSBundle.MainBundle) {
     this.Controller = controller;
     this.Initialize();
 }
 // Call to load from the XIB/NIB file
 public SetupSubFinishedController (SetupController controller) : base ("SetupSubFinished", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize ();
 }
示例#12
0
 // Call to load from the XIB/NIB file
 public SetupSubFinishedController(SetupController controller) : base("SetupSubFinished", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize();
 }
 // Call to load from the XIB/NIB file
 public SetupSubTutorialEndController (SetupController controller) : base ("SetupSubTutorialEnd", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize ();
 }
 // Call to load from the XIB/NIB file
 public SetupSubLoginController(SetupController controller) : base("SetupSubLogin", NSBundle.MainBundle)
 {
     this.Controller = controller;
     this.Initialize();
 }