コード例 #1
0
        public IEnumerable <StoryboardVariable> EnumValues()
        {
            foreach (var line in reader.EnumValues())
            {
                var arr = line.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
                if (arr.Length != 2)
                {
                    continue;
                }

                var variable = new StoryboardVariable();
                variable.Name  = arr.First();
                variable.Value = arr.Last();

                yield return(variable);
            }
        }
コード例 #2
0
        public IEnumerable <StoryboardPacket> EnumValues()
        {
            foreach (var line in reader.EnumValues())
            {
                var decode_line = LineProcessVariable(line);

                switch (CheckLineType(decode_line))
                {
                case LineType.Object:
                    //return current object
                    var t = packet;

                    packet = new StoryboardPacket();
                    packet.CommandLines   = new List <string>();
                    packet.ObjectFileLine = reader.FileLine;
                    packet.ObjectLine     = decode_line;

                    if (t != StoryboardPacket.Empty)
                    {
                        yield return(t);
                    }

                    break;

                case LineType.Command:
                    packet.CommandLines.Add(decode_line);
                    break;

                //ignore comment/space only
                case LineType.Others:
                default:
                    break;
                }
            }

            if (packet != StoryboardPacket.Empty)
            {
                yield return(packet);

                packet = StoryboardPacket.Empty;
            }
        }