예제 #1
0
        public void can_replace_arg()
        {
            var args = new Args();
            args.AddOrReplace("arg1", "A");
            args.AddOrReplace("arg1", "B");

            Assert.AreEqual("B", args["arg1"]);
        }
예제 #2
0
        public override void ResumeFrom(string wizardName, Args args)
        {
            if (wizardName == "LeftList")
                leftList.Items.Add(args["Value"].ToString());

            if (wizardName == "RightList")
                rightList.Items.Add(args["Value"].ToString());
        }
예제 #3
0
        public void can_add_colection_of_args_to_a_step_in_constructor()
        {
            var args = new Args();
            args.AddOrReplace("arg1", "A");
            args.AddOrReplace("arg2", "B");

            var step = new WizardStep(args);

            Assert.AreEqual(args, step.Args);
        }
예제 #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var argsForStep2 = new Args();
            argsForStep2.AddOrReplace("arg1", "abcdef");
            argsForStep2.AddOrReplace("arg2", "bcdef");
            argsForStep2.AddOrReplace("arg3", "cdef");
            argsForStep2.AddOrReplace("arg4", "efghi");
            argsForStep2.AddOrReplace("arg5", "fghijkl");

            IWizardView view = new SimpleWizardView();
            var controller = new WizardController(view);

            var wizard = new Wizard();
            wizard.AddStep(new Step1(argsForStep2))
                  .AddStep(new Step2(argsForStep2));
            controller.Start(wizard);

            Application.Run(view as Form);
        }
예제 #5
0
 public override void ResumeFrom(string wizardName, Args args)
 {
     listBox1.Items.Add(args["Value"].ToString());
 }
예제 #6
0
 public Step1(Args args)
     : base(args)
 {
     InitializeComponent();
 }
예제 #7
0
 public WizardEventArgs(Args arguments)
 {
     Arguments = arguments;
 }
예제 #8
0
 public void Unload(Args args)
 {
     var arguments = new WizardEventArgs(args);
     if (Unloaded != null) Unloaded(this, arguments);
 }
예제 #9
0
 public virtual void ResumeFrom(string wizardName, Args args)
 {
 }
예제 #10
0
 public WizardStep(Args args)
 {
     InitializeComponent();
     _args = args;
 }
예제 #11
0
 public void can_create_empty_args()
 {
     var args = new Args();
     Assert.AreEqual(0, args.Count );
 }
예제 #12
0
 public override void ResumeFrom(string wizardName, Args args)
 {
     lstCourses.Items.Add(string.Format("{0} [{1}]",args["Title"], args["Code"]));
 }