Example #1
0
        private VarIncrement LoadIncrement()
        {
            var elementName = reader.LocalName;
            var value       = GetContent();

            if (!Regex.IsMatch(value, VarIncrement.Pattern))
            {
                throw new StoryboardParsingException(reader, elementName, value);
            }

            var increment = VarIncrement.Parse(value);

            if (!increment.HasValue)
            {
                throw new StoryboardParsingException(reader, elementName, value);
            }

            return(increment.Value);
        }
Example #2
0
        private void HandleSet()
        {
            var elementName = reader.LocalName;
            var condition   = LookForCondition();
            var value       = GetContent();

            if (Regex.IsMatch(value, VarIncrement.Pattern))
            {
                var increment = VarIncrement.Parse(value);
                if (!increment.HasValue)
                {
                    throw new StoryboardParsingException(reader, elementName, value);
                }
                Add(new VarIncrementItem(increment.Value, condition));
                return;
            }

            if (!Regex.IsMatch(value, varNamePattern))
            {
                throw new StoryboardParsingException(reader, elementName, value);
            }

            Add(new VarSetItem(value, 1, condition));
        }