상속: System.Windows.Forms.Control
예제 #1
0
        public void Setup()
        {
            InitializeControl = () =>
            {
                _winformsWizard = new WinForms.WizardControl();

                _winformsWizard.Cancelled += (sender, e) =>
                {
                    if (this.Cancelled != null)
                    {
                        this.Cancelled(sender, e);
                    }
                };

                _winformsWizard.Finished += (sender, e) =>
                {
                    if (this.Finished != null)
                    {
                        this.Finished(sender, e);
                    }
                };

                _winformsWizard.SelectedPageChanged += (sender, e) =>
                {
                    if (this.SelectedPageChanged != null)
                    {
                        this.SelectedPageChanged(sender, e);
                    }
                };
            };

            GetSelectedPage = () => new WizardAdapterPage(_winformsWizard.SelectedPage);

            GetPages = () =>
            {
                if (_pages == null)
                {
                    _pages = new List <WizardAdapterPage>();
                    foreach (var page in _winformsWizard.Pages)
                    {
                        _pages.Add(new WizardAdapterPage(page));
                    }
                }

                return(_pages);
            };

            GetTitle            = () => _winformsWizard.Title;
            SetTitle            = (value) => _winformsWizard.Title = value;
            GetNextButtonText   = () => _winformsWizard.NextButtonText;
            SetNextButtonText   = (value) => _winformsWizard.NextButtonText = value;
            GetFinishButtonText = () => _winformsWizard.FinishButtonText;
            SetFinishButtonText = (value) => _winformsWizard.FinishButtonText = value;
            GetCancelButtonText = () => _winformsWizard.CancelButtonText;
            SetCancelButtonText = (value) => _winformsWizard.CancelButtonText = value;
            GetIcon             = () => _winformsWizard.TitleIcon;
            SetIcon             = (icon) => _winformsWizard.TitleIcon = icon;

            BeginInitLogic = () => _winformsWizard.BeginInit();
            EndInitLogic   = () =>
            {
                foreach (WizardAdapterPage page in _pages)
                {
                    page.WinFormPage.AddControls(page.Controls.Cast <Control>().ToArray());

                    _winformsWizard.Pages.Add(page.WinFormPage);
                }

                this.Controls.Add(_winformsWizard);

                _winformsWizard.EndInit();
            };
            AfterInitialization = () => _winformsWizard.ShowFirstPage();
        }
        public void Setup()
        {
            InitializeControl = () =>
            {
                _winformsWizard = new WinForms.WizardControl();

                _winformsWizard.Cancelled += (sender, e) =>
                {
                    if (this.Cancelled != null)
                        this.Cancelled(sender, e);
                };

                _winformsWizard.Finished += (sender, e) =>
                {
                    if (this.Finished != null)
                        this.Finished(sender, e);
                };

                _winformsWizard.SelectedPageChanged += (sender, e) =>
                {
                    if (this.SelectedPageChanged != null)
                        this.SelectedPageChanged(sender, e);
                };
            };

            GetSelectedPage = () => new WizardAdapterPage(_winformsWizard.SelectedPage);

            GetPages = () =>
            {
                if (_pages == null)
                {
                    _pages = new List<WizardAdapterPage>();
                    foreach (var page in _winformsWizard.Pages)
                    {
                        _pages.Add(new WizardAdapterPage(page));
                    }
                }

                return _pages;
            };

            GetTitle = () => _winformsWizard.Title;
            SetTitle = (value) => _winformsWizard.Title = value;
            GetNextButtonText = () => _winformsWizard.NextButtonText;
            SetNextButtonText = (value) => _winformsWizard.NextButtonText = value;
            GetFinishButtonText= () => _winformsWizard.FinishButtonText;
            SetFinishButtonText= (value) => _winformsWizard.FinishButtonText = value;
            GetCancelButtonText = () => _winformsWizard.CancelButtonText;
            SetCancelButtonText = (value) => _winformsWizard.CancelButtonText = value;
            GetIcon = () => _winformsWizard.TitleIcon;
            SetIcon = (icon) => _winformsWizard.TitleIcon = icon;

            BeginInitLogic = () => _winformsWizard.BeginInit();
            EndInitLogic = () =>
            {
                foreach (WizardAdapterPage page in _pages)
                {
                    page.WinFormPage.AddControls(page.Controls.Cast<Control>().ToArray());

                    _winformsWizard.Pages.Add(page.WinFormPage);
                }

                this.Controls.Add(_winformsWizard);

                _winformsWizard.EndInit();
            };
            AfterInitialization = () => _winformsWizard.ShowFirstPage();
        }