コード例 #1
0
ファイル: BaseWizard.cs プロジェクト: Yellllllow/swb
        /// <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);
        }
コード例 #2
0
ファイル: BaseWizard.cs プロジェクト: Yellllllow/swb
        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);
        }
コード例 #3
0
ファイル: BaseWizard.cs プロジェクト: Yellllllow/swb
        protected void SetCurrentStep(BaseStep step, StepDirection dir)
        {
            SuspendLayout();

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

                currentStep = step;

                AttachStep(dir);
            }
            finally
            {
                ResumeLayout(true);
            }
        }
コード例 #4
0
ファイル: BaseWizard.cs プロジェクト: Yellllllow/swb
        /// <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);
                    }
                }
            }
        }
コード例 #5
0
 public void Add(string key, BaseStep value)
 {
     innerHash.Add(key, value);
 }
コード例 #6
0
 public bool ContainsValue(BaseStep value)
 {
     return(innerHash.ContainsValue(value));
 }
コード例 #7
0
ファイル: BaseWizard.cs プロジェクト: lypvc/TSWizard
 /// <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;
 }