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;
                        }
                    });
                }
            };
        }
コード例 #3
0
        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();
 }
コード例 #5
0
 // 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();
 }
コード例 #7
0
 // Call to load from the XIB/NIB file
 public SetupSubRepoSelectController(SetupController controller) : base("SetupSubRepoSelect", NSBundle.MainBundle)
 {
     this.Controller = controller;
     this.Initialize();
 }
コード例 #8
0
 // 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();
 }
コード例 #10
0
 // Call to load from the XIB/NIB file
 public SetupSubRepoSelectController(SetupController controller) : base("SetupSubRepoSelect", NSBundle.MainBundle) {
     this.Controller = controller;
     this.Initialize();
 }
コード例 #11
0
 // 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();
 }
コード例 #13
0
 // Call to load from the XIB/NIB file
 public SetupSubTutorialEndController (SetupController controller) : base ("SetupSubTutorialEnd", NSBundle.MainBundle)
 {
     this.Controller = controller;
     Initialize ();
 }
コード例 #14
0
 // Call to load from the XIB/NIB file
 public SetupSubLoginController(SetupController controller) : base("SetupSubLogin", NSBundle.MainBundle)
 {
     this.Controller = controller;
     this.Initialize();
 }