Ejemplo n.º 1
0
        private static ToolStripMenuItem Parse(XmlNode node)
        {
            ToolStripMenuItem item = ActionFactory.GetAction(node).ToMenuItem();

            if (item == null)
            {
                return(null);
            }

            // Add folder items.
            if (node.Name.ToLowerInvariant() == "root")
            {
                foreach (XmlNode subNode in node.ChildNodes)
                {
                    var subMenuItem = Parse(subNode);

                    if (subMenuItem != null)
                    {
                        item.DropDown.Items.Add(subMenuItem);
                    }
                }

                return(item);
            }

            return(item);
        }
Ejemplo n.º 2
0
        // GET: Admin/Actions/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var discountAction = _actionFactory.GetAction(id);

            if (discountAction == null)
            {
                return(NotFound());
            }

            return(View(discountAction));
        }
Ejemplo n.º 3
0
 public BattleState()
 {
     actions = new List <IAction> {
         ActionFactory.GetAction <MovePirateDuringEventAction>(),
         ActionFactory.GetAction <UserInputAction>()
     };
 }
Ejemplo n.º 4
0
        public FinishGraphic(string key, XmlElement elementData, System.Collections.Generic.SortedList <string, Variable> variables)
            : base(key)
        {
            this.needInit = System.Convert.ToBoolean(Finish.NeedInit);
            this.Surface.Blit(new Surface(Finish.GraphicIcon));
            this.element = ActionFactory.GetAction(this.key);
            foreach (XmlElement nodo in elementData)
            {
                switch (nodo.Name)
                {
                case "position":
                    this.Center = new Point(System.Convert.ToInt32(nodo.ChildNodes[0].InnerText), System.Convert.ToInt32(nodo.ChildNodes[1].InnerText));
                    break;

                case "properties":
                    this.element = new FinishAction(key, nodo);
                    break;

                case "previous":
                    break;

                case "next":
                    break;

                default:
                    throw new GraphException("Error al crear GraphStart");
                }
            }
        }
Ejemplo n.º 5
0
 public MapState()
 {
     actions = new List <IAction> {
         ActionFactory.GetAction <OpenCloseMapAction>(),
         ActionFactory.GetAction <UserInputAction>()
     };
 }
Ejemplo n.º 6
0
 public FinishGraphic(string key)
     : base(key)
 {
     this.needInit = System.Convert.ToBoolean(Finish.NeedInit);
     this.Surface.Blit(new Surface(Finish.GraphicIcon));
     this.element = ActionFactory.GetAction(this.key);
 }
Ejemplo n.º 7
0
 public GameState()
 {
     actions = new List <IAction> {
         ActionFactory.GetAction <MovePirateDuringEventAction>(),
         ActionFactory.GetAction <OpenCloseMapAction>(),
         ActionFactory.GetAction <UserInputAction>()
     };
 }
Ejemplo n.º 8
0
        public GraphModule(string key)
        {
            this.key     = key;
            this.element = ActionFactory.GetAction(this.key);
            this.Surface = new Surface(new Size(80, 54));
            this.Surface.Fill(GraphDiagram.TRASPARENT_COLOR);
            this.Surface.Transparent      = true;
            this.Surface.TransparentColor = GraphDiagram.TRASPARENT_COLOR;

            CreateConnectors();
        }
        public GraphConditional(string key)
        {
            this.key     = key;
            this.element = ActionFactory.GetAction(this.key);
            this.Surface = new SdlDotNet.Graphics.Surface(new Size(102, 76));
            this.Surface.Fill(GraphDiagram.TRASPARENT_COLOR);
            this.Transparent      = true;
            this.TransparentColor = GraphDiagram.TRASPARENT_COLOR;

            CreateConnectors();
        }
Ejemplo n.º 10
0
        public ScheduleService()
        {
            List <Schedule> theSchedules = Config.GetSchedules();

            foreach (var theSchedule in theSchedules)
            {
                var theActions = new List <IAction>();

                foreach (var theScheduleAction in theSchedule.ScheduleActions)
                {
                    var theAction = _actionFactory.GetAction((ActionEnum)theScheduleAction.ActionId);
                    theAction.SetConnectors((ConnectorEnum)theScheduleAction.InConnectorId, (ConnectorEnum)theScheduleAction.OutConnectorId);
                    theActions.Add(theAction);
                }

                var theScheduleModel = new ScheduleModel(theSchedule.Interval, (DateInterval)theSchedule.IntervalStepId, theActions);

                _schedules.Add(theScheduleModel);
            }
        }