Esempio n. 1
0
        protected override bool DispatchInput(object sender, MVC.UserInputArgs args)
        {
            switch (args.Command)
            {
            case "back":
                NextViewType = typeof(CarsView);
                return(false);

            case "ch-prod":
                if (args.Arguments.Count != 1)
                {
                    break;
                }

                ChangeProducer(args.Arguments[0]);
                return(true);

            case "ch-model":
                if (args.Arguments.Count != 1)
                {
                    break;
                }

                ChangeModelName(args.Arguments[0]);
                return(true);
            }

            return(base.DispatchInput(sender, args));
        }
Esempio n. 2
0
        protected override bool DispatchInput(object sender, MVC.UserInputArgs args)
        {
            switch (args.Command)
            {
            case "save":
                SaveModel();
                return(true);

            case "add":
                if (args.Arguments.Count != 3)
                {
                    break;
                }

                AddCar(args.Arguments[0], args.Arguments[1], args.Arguments[2]);
                return(true);

            case "del":
                if (args.Arguments.Count != 1)
                {
                    break;
                }

                DeleteCar(Int32.Parse(args.Arguments[0]));
                return(true);

            case "back":
                NextViewType = typeof(MainView);
                return(false);

            case "edit":
                if (args.Arguments.Count != 1)
                {
                    break;
                }

                NextViewType      = typeof(CarView);
                InvocationContext = new CarView.Context()
                {
                    Model = GetCar(Int32.Parse(args.Arguments[0]))
                };
                return(false);
            }

            return(base.DispatchInput(sender, args));
        }
Esempio n. 3
0
        protected override bool DispatchInput(object sender, MVC.UserInputArgs args)
        {
            switch (args.Command)
            {
            case "show":
                if (args.Arguments.Count != 1)
                {
                    break;
                }

                switch (args.Arguments[0].ToLower())
                {
                case "cars":
                    NextViewType = typeof(Views.CarsView);
                    return(false);
                }
                break;
            }

            return(base.DispatchInput(sender, args));
        }