Beispiel #1
0
        /// <summary>
        /// Closes the current page after a <see cref="WizardPage.CloseFromNext"/>, then moves to
        /// the Next page and calls <see cref="WizardPage.ShowFromNext"/>
        /// </summary>
        public void Next()
        {
            Debug.Assert(PageIndex >= 0, "Page Index was below 0");

            PageEventArgs pageEventArgs = vActivePage.OnCloseFromNext(this);
            //Tell the Application I just closed a Page
            int newPageIndex = pageEventArgs.PageIndex;

            //Did I just press Finish instead of Next
            if (newPageIndex < vPages.Count && (vActivePage.IsFinishPage == false || DesignMode))
            {
                ActivatePage(newPageIndex);
                //No still going
                //Tell the application, I have just shown a page
                vActivePage.OnShowFromNext(this);
            }
            else
            {
                Debug.Assert(PageIndex < vPages.Count,
                             "Error I've just gone past the finish",
                             "btnNext_Click tried to go to page " + Convert.ToString(PageIndex + 1) + ", but I only have " +
                             Convert.ToString(vPages.Count));
                //yep Finish was pressed
                if (DesignMode == false && pageEventArgs.CloseInFinsh)
                {
                    ParentForm.Close();
                }
            }
        }
		/// <summary>
		/// Fires the CloseFromNextEvent
		/// </summary>
		/// <param name="wiz">Sender</param>
		public int OnCloseFromNext(Wizard wiz)
		{	
			//Event args thinks that the next pgae will be the one before this one
			PageEventArgs e = new PageEventArgs(wiz.PageIndex +1, wiz.Pages);
			//Tell anybody who listens
			if (CloseFromNext != null)
				CloseFromNext(wiz, e);
			//And then tell whomever called me what the prefered page is
			return e.PageIndex;
		}
Beispiel #3
0
        /// <summary>
        /// Fires the CloseFromNextEvent
        /// </summary>
        /// <param name="wiz">Sender</param>
        public int OnCloseFromNext(Wizard wiz)
        {
            //Event args thinks that the next pgae will be the one before this one
            PageEventArgs e = new PageEventArgs(wiz.PageIndex + 1, wiz.Pages);

            //Tell anybody who listens
            if (CloseFromNext != null)
            {
                CloseFromNext(wiz, e);
            }
            //And then tell whomever called me what the prefered page is
            return(e.PageIndex);
        }
Beispiel #4
0
        private void ProfileSelected(object sender, Gui.Wizard.PageEventArgs e)
        {
            IXEditNetProfile tmp = null;

            if (treeView1.SelectedNode == null)
            {
                MessageBox.Show(this, "Please select a wizard to create a new document", "Select Profile", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            object o = treeView1.SelectedNode.Tag;

            if (o is IXEditNetProfile)
            {
                tmp = (IXEditNetProfile)o;
            }
            else if (o is ProfileInfo)
            {
                tmp = new RegisteredTypeProfile((ProfileInfo)o);
            }

            if (tmp != null && tmp == currentProfile)
            {
                return;                 // use previous wizard instance
            }
            currentProfile = tmp;
            if (currentProfile == null)
            {
                throw new InvalidOperationException("Tag for selected node is null!");
            }

            while (wizard1.Pages.Count > 1)
            {
                wizard1.Pages.RemoveAt(1);
            }

            wizardPlugin = currentProfile.GetCreateWizardPlugin();
            if (wizardPlugin == null)
            {
                OnWizardFinished(new EventArgs());
                return;
            }
            wizard1.Pages.AddRange(wizardPlugin.Pages);

            wizard1.PageIndex = 0;
            e.Page            = wizard1.Pages[1];
        }
        private void wizardPageWelcome_CloseFromNext(object sender, PageEventArgs e)
        {
            rtfWelcomeStatus.LoggingEnabled = false;

            if (mSkipToDriverResourceLocator)
            {
                mSkipToDriverResourceLocator = false;
                return;
            }
            if (DriverResManager.Check())
            {
                SynchronizationContext.Current.Post(moveToWizardPage, wizardPageSelectDevice);
            }
        }
 private void wizardPageSelectDevice_CloseFromBack(object sender, PageEventArgs e)
 {
     SynchronizationContext.Current.Post(moveToWizardPage, wizardPageWelcome);
 }
 private void wizardPageFinished_CloseFromNext(object sender, PageEventArgs e)
 {
     // TODO: Move ShellExecute to a button on the final wizard page.
     ShellExecute(IntPtr.Zero, "open", mCurrentDeviceItem.SaveDirectory, null, null, ShowCommands.SW_SHOWNORMAL);
     e.CloseInFinsh = true;
 }
 private void wizardPageFinished_CloseFromBack(object sender, PageEventArgs e)
 {
     rtfFinishedSatus.LoggingEnabled = false;
 }
 private void wizardPageConfigDevice_CloseFromNext(object sender, PageEventArgs e)
 {
     mSettings.Last_SaveDirectory = mCurrentDeviceItem.SaveDirectory;
     mSettings.Save();
 }
 private void wizardPageConfigDevice_CloseFromBack(object sender, PageEventArgs e)
 {
     mSettings.Last_CreateDriverDirectory = mCurrentDeviceItem.CreateDriverDirectory;
     mSettings.Last_SaveDirectory = mCurrentDeviceItem.SaveDirectory;
 }