示例#1
0
        /// <summary>
        /// Adds this position to the specified one.
        /// </summary>
        public SpanPosition AddTo(SpanPosition other)
        {
            var result = new SpanPosition();
            if (LineNumber > 1)
            {
                result.PositionOnLine += other.PositionOnLine;
            }
            else
            {
                result.PositionOnLine = PositionOnLine;
            }
            result.LineNumber = other.LineNumber + LineNumber - 1;
            result.AbsolutePosition = other.AbsolutePosition + AbsolutePosition;
            result.Length = Length;

            return result;
        }
示例#2
0
 private void ValidateSpanContent(string input, string expectedValue, SpanPosition span)
 {
     string actualValue = input.Substring(span.AbsolutePosition, span.Length);
     Assert.AreEqual(expectedValue, actualValue);
 }
示例#3
0
 public RwHtmlParsingException(string message, SpanPosition span)
     : base(message)
 {
     this.Span = span;
 }