Beispiel #1
0
        /// <summary>
        /// Removes a step from the wizard
        /// </summary>
        /// <param name="name">The name of the step to remove</param>
        /// <returns>The step removed, returns null if no step by that name was in the list of steps</returns>
        public BaseStep RemoveStep(string name)
        {
            BaseStep step = Steps[name];

            if (step != null)
            {
                Steps.Remove(name);
            }

            return(step);
        }
Beispiel #2
0
        public void SetCurrentStep(string name, StepDirection dir)
        {
            if (name == null || name == "")
            {
                throw new ArgumentException("Step is null or empty", "step");
            }

            BaseStep bws = steps[name];

            if (bws == null)
            {
                throw new ArgumentException("Step does not contain the name of a step in the wizard", "name");
            }

            SetCurrentStep(bws, dir);
        }
Beispiel #3
0
        protected void SetCurrentStep(BaseStep step, StepDirection dir)
        {
            SuspendLayout();

            try
            {
                if (currentStep != null)
                {
                    DetatchStep();
                }

                currentStep = step;

                AttachStep(dir);
            }
            finally
            {
                ResumeLayout(true);
            }
        }
Beispiel #4
0
        /// <summary>
        /// Adds a step to the wizard
        /// </summary>
        /// <param name="name">The name of the step, this will be used as the name to look for in the PreviousStep and NextStep properties of the step</param>
        /// <param name="step">The step object to add</param>

        /*public void AddStep(string name, BaseStep step)
         * {
         *      Steps[name] = step;
         * }*/
        public void AddStep(BaseStep step)
        {
            String prefix = "Step";

            step.PreviousStep           = "";
            step.NextStep               = "";
            Steps[prefix + Steps.Count] = step;
            for (int i = 0; i < Steps.Count; i++)
            {
                if (Steps.Count == 1)
                {
                    Steps[prefix + i].PreviousStep = "";
                    Steps[prefix + i].NextStep     = "";
                    Steps[prefix + i].IsFinished   = true;
                    this.firstStep = prefix + i;
                }
                else
                {
                    Steps[prefix + i].IsFinished = false;
                    if (i == 0)
                    {
                        this.firstStep = prefix + i;
                        Steps[prefix + i].PreviousStep = "";
                        Steps[prefix + i].NextStep     = prefix + (i + 1);
                    }
                    else if (i == (Steps.Count - 1))
                    {
                        Steps[prefix + i].PreviousStep = prefix + (i - 1);;
                        Steps[prefix + i].NextStep     = "";
                        Steps[prefix + i].IsFinished   = true;
                    }
                    else
                    {
                        Steps[prefix + i].PreviousStep = prefix + (i - 1);;
                        Steps[prefix + i].NextStep     = prefix + (i + 1);
                    }
                }
            }
        }
Beispiel #5
0
 public void Add(string key, BaseStep value)
 {
     innerHash.Add(key, value);
 }
Beispiel #6
0
 public bool ContainsValue(BaseStep value)
 {
     return(innerHash.ContainsValue(value));
 }
Beispiel #7
0
 /// <summary>
 /// Adds a step to the wizard
 /// </summary>
 /// <param name="name">The name of the step, this will be used as the name to look for in the PreviousStep and NextStep properties of the step</param>
 /// <param name="step">The step object to add</param>
 public void AddStep(string name, BaseStep step)
 {
     Steps[name] = step;
 }