コード例 #1
0
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);
            base.AutoResizeHandles = true;
            ISelectionService ss = SelectionService;

            if (ss != null)
            {
                ss.SelectionChanged += OnSelectionChanged;
            }
            IComponentChangeService ccs = ComponentChangeService;

            if (ccs != null)
            {
                ccs.ComponentChanged += OnComponentChanged;
            }
            WizardPageContainer wc = this.WizardPageContainer;

            if (wc != null)
            {
                wc.SelectedPageChanged += WizardPageContainer_SelectedPageChanged;
                //wc.GotFocus += WizardPageContainer_OnGotFocus;
                wc.ControlAdded += WizardPageContainer_OnControlAdded;
            }
        }
コード例 #2
0
        internal void InsertPageIntoWizard(bool add)
        {
            IDesignerHost           h   = this.DesignerHost;
            IComponentChangeService c   = this.ComponentChangeService;
            WizardPageContainer     wiz = this.WizardPageContainer;

            if (h == null || c == null)
            {
                throw new ArgumentNullException("Both IDesignerHost and IComponentChangeService arguments cannot be null.");
            }

            DesignerTransaction dt = null;

            try
            {
                dt = h.CreateTransaction("Insert Wizard Page");
                WizardPage       page   = (WizardPage)h.CreateComponent(typeof(WizardPage));
                MemberDescriptor member = TypeDescriptor.GetProperties(wiz)["Pages"];
                base.RaiseComponentChanging(member);
                //c.OnComponentChanging(wiz, null);

                //Add a new page to the collection
                if (wiz.Pages.Count == 0 || add)
                {
                    wiz.Pages.Add(page);
                }
                else
                {
                    wiz.Pages.Insert(wiz.SelectedPageIndex, page);
                }

                //c.OnComponentChanged(wiz, null, null, null);
                base.RaiseComponentChanged(member, null, null);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Commit();
                }
            }
            RefreshDesigner();
        }
コード例 #3
0
        private void PrevPage()
        {
            WizardPageContainer wiz = this.Component as WizardPageContainer;

            wiz.PreviousPage();
        }
コード例 #4
0
        private void NextPage()
        {
            WizardPageContainer wiz = this.Component as WizardPageContainer;

            wiz.NextPage();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="WizardPageCollection"/> class.
 /// </summary>
 /// <param name="owner">The <see cref="WizardControl"/> that this collection belongs to.</param>
 internal WizardPageCollection(WizardPageContainer owner)
 {
     Owner = owner;
 }