예제 #1
0
파일: Button.cs 프로젝트: bundie1990/EDGE
        public IEnumerable <ushort> AddEvents(XElement element)
        {
            for (var i = 0; i < 4; i++)
            {
                var type = (BlockEventType)i;
                var attr = element.GetAttributeValue(type.ToString() + 's');
                if (attr == null)
                {
                    continue;
                }
                foreach (var e in attr.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                         .Select(str => BlockEvent.Parse(Parent, type, str)))
                {
                    yield return((ushort)BlockEvents.Count);

                    BlockEvents.Add(e);
                }
            }
        }