internal override Element Parse(XElement element) { base.ParseXml(element); if (element.HasElements) { List <Element> nodes = new List <Element>(); element.Elements().ToList().ForEach(entry => { string nodeName = entry.Name.LocalName; if (ElementContainer.Contains(nodeName)) { nodes.Add(ElementContainer .Resolve(nodeName) .Parse(entry)); } }); Element cmd = nodes.Where(entry => (entry is Command)).FirstOrDefault(); this.command = cmd == null ? null : (cmd as Command); nodes .Where(transition => (transition is Transition)) .ToList() .ForEach(g => { this.Transitions.Add(g as Transition); }); } return(this); }
internal override Element Parse(XElement element) { base.ParseXml(element); if (element.HasElements) { List <Element> nodes = new List <Element>(); element.Elements().ToList().ForEach(entry => { string nodeName = entry.Name.LocalName; if (ElementContainer.Contains(nodeName)) { nodes.Add(ElementContainer .Resolve(nodeName) .Parse(entry)); } }); nodes .Where(group => (group is Group)) .ToList() .ForEach(g => { this.Groups.Add(g as Group); }); nodes .Where(transition => (transition is Transition)) .ToList() .ForEach(g => { this.Transitions.Add(g as Transition); }); nodes .Where(actor => (actor is Actor)) .ToList() .ForEach(actor => { this.actors.Add(actor as Actor); }); nodes .Where(action => (action is Action)) .ToList() .ForEach(action => { this.actions.Add(action as Action); }); } return(this); }