Example #1
0
        private void parseVRule(String word)
        {
            String[] tokens1 = CommandSplitter.split(word);
            if (tokens1.Length < 2 || tokens1.Length > 3)
            {
                throw new ArgumentException("Invalid VRULE statement: " + word);
            }

            String[] tokens2 = tokens1[1].Split('#');
            if (tokens2.Length != 2)
            {
                throw new ArgumentException("Invalid VRULE statement: " + word);
            }

            long timestamp;

            if (!long.TryParse(tokens2[0], out timestamp))
            {
                DateTime time;
                if (!DateTime.TryParse(tokens2[0], out time))
                {
                    throw new ArgumentException("Wrong time format in VRULE " + tokens2[0]);
                }
                timestamp = Util.getTimestamp(time);
            }
            Color color = Util.parseColor(tokens2[1]);

            gdef.vrule(timestamp, color, tokens1.Length == 3 ? tokens1[2] : null);
        }