CmisSync.SetupController.BackToPage2 C# (CSharp) Method

BackToPage2() public method

Switch back from customization to step 2 of the remote folder addition wizard.
public BackToPage2 ( ) : void
return void
        public void BackToPage2()
        {
            ignoredPaths.Clear();
            ChangePageEvent(PageType.Add2);
        }

Usage Example

示例#1
0
        void ShowCustomizePage()
        {
            Header = Properties_Resources.Customize;
            string localfoldername = Controller.saved_address.Host.ToString();

            foreach (KeyValuePair <String, String> repository in Controller.repositories)
            {
                if (repository.Key == Controller.saved_repository)
                {
                    localfoldername += "/" + repository.Value;
                    break;
                }
            }
            NSTextField LocalFolderLabel = new NSTextField()
            {
                Alignment       = NSTextAlignment.Left,
                BackgroundColor = NSColor.WindowBackground,
                Bordered        = false,
                Editable        = false,
                Frame           = new RectangleF(190, 320, 196 + 196 + 16, 17),
                Font            = GUI.BoldFont,
                StringValue     = Properties_Resources.EnterLocalFolderName
            };
            NSTextField LocalFolderTextField = new NSTextField()
            {
                Frame       = new RectangleF(190, 290, 196 + 196 + 16, 22),
                Font        = GUI.Font,
                Delegate    = new TextFieldDelegate(),
                StringValue = localfoldername
            };
            NSTextField LocalRepoPathLabel = new NSTextField()
            {
                Alignment       = NSTextAlignment.Left,
                BackgroundColor = NSColor.WindowBackground,
                Bordered        = false,
                Editable        = false,
                Frame           = new RectangleF(190, 220, 196 + 196 + 16, 17),
                Font            = GUI.BoldFont,
                StringValue     = Properties_Resources.ChangeRepoPath
            };
            NSTextField LocalRepoPathTextField = new NSTextField()
            {
                Frame       = new RectangleF(190, 190, 196 + 196 + 16 - 60, 22),
                Font        = GUI.Font,
                Delegate    = new TextFieldDelegate(),
                StringValue = Path.Combine(Controller.DefaultRepoPath, LocalFolderTextField.StringValue)
            };

            WarningTextField = new NSTextField()
            {
                BackgroundColor = NSColor.WindowBackground,
                Bordered        = false,
                TextColor       = NSColor.Red,
                Editable        = false,
                Frame           = new RectangleF(190, 30, 196 + 196 + 16, 140),
                Font            = NSFontManager.SharedFontManager.FontWithFamily("Lucida Grande", NSFontTraitMask.Condensed, 0, 11),
            };
            WarningTextField.Cell.LineBreakMode = NSLineBreakMode.ByWordWrapping;
            ContinueButton = new NSButton()
            {
                Title   = Properties_Resources.Add,
                Enabled = false
            };
            NSButton BackButton = new NSButton()
            {
                Title = Properties_Resources.Back
            };

            CancelButton = new NSButton()
            {
                Title = Properties_Resources.Cancel
            };
            NSButton ChooseFolderButton = new NSButton()
            {
                Title = "...",
                Frame = new RectangleF(190 + 196 + 196 + 16 - 40, 190, 40, 22)
            };

            ChooseFolderButton.Activated += delegate
            {
                NSOpenPanel OpenPanel = NSOpenPanel.OpenPanel;
                OpenPanel.AllowsMultipleSelection = false;
                OpenPanel.CanChooseFiles          = false;
                OpenPanel.CanChooseDirectories    = true;
                OpenPanel.CanCreateDirectories    = true;
                OpenPanel.DirectoryUrl            = new NSUrl("file://localhost" + Controller.DefaultRepoPath);
                if (OpenPanel.RunModal() == 1)
                {
                    string path = OpenPanel.Urls[0].Path;
                    try{
                        LocalRepoPathTextField.StringValue = Path.Combine(path, LocalFolderTextField.StringValue);
                    } catch (Exception) {
                        LocalRepoPathTextField.StringValue = path;
                    }
                    CheckCustomizeInput(LocalFolderTextField, LocalRepoPathTextField, WarningTextField);
                }
            };

            BackButton.Activated += delegate
            {
                Controller.BackToPage2();
            };
            CancelButton.Activated += delegate
            {
                Controller.PageCancelled();
            };
            ContinueButton.Activated += delegate
            {
                Controller.CustomizePageCompleted(LocalFolderTextField.StringValue, LocalRepoPathTextField.StringValue);
            };
            (LocalFolderTextField.Delegate as TextFieldDelegate).StringValueChanged += delegate
            {
                try
                {
                    LocalRepoPathTextField.StringValue = Path.Combine(Controller.DefaultRepoPath, LocalFolderTextField.StringValue);
                }
                catch (Exception)
                {
                }
                CheckCustomizeInput(LocalFolderTextField, LocalRepoPathTextField, WarningTextField);
            };
            (LocalRepoPathTextField.Delegate as TextFieldDelegate).StringValueChanged += delegate
            {
                CheckCustomizeInput(LocalFolderTextField, LocalRepoPathTextField, WarningTextField);
            };
            {
                CheckCustomizeInput(LocalFolderTextField, LocalRepoPathTextField, WarningTextField);
            }
            ContentView.AddSubview(LocalFolderLabel);
            ContentView.AddSubview(LocalFolderTextField);
            ContentView.AddSubview(LocalRepoPathLabel);
            ContentView.AddSubview(LocalRepoPathTextField);
            ContentView.AddSubview(ChooseFolderButton);
            ContentView.AddSubview(WarningTextField);
            Buttons.Add(ContinueButton);
            Buttons.Add(BackButton);
            Buttons.Add(CancelButton);
        }
All Usage Examples Of CmisSync.SetupController::BackToPage2