/*
* Created by SharpDevelop.
* User: Daniel
* Date: 2/20/2012
* Time: 17:46
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using ICSharpCode.NRefactory.Editor;
namespace ICSharpCode.NRefactory.Xml
{
///
/// A syntax error.
///
public class SyntaxError : ISegment
{
readonly int startOffset;
readonly int endOffset;
readonly string description;
///
/// Creates a new syntax error.
///
public SyntaxError(int startOffset, int endOffset, string description)
{
if (description == null)
throw new ArgumentNullException("description");
this.startOffset = startOffset;
this.endOffset = endOffset;
this.description = description;
}
///
/// Gets a description of the syntax error.
///
public string Description {
get { return description; }
}
///
/// Gets the start offset of the segment.
///
public int StartOffset {
get { return startOffset; }
}
int ISegment.Offset {
get { return startOffset; }
}
///
public int Length {
get { return endOffset - startOffset; }
}
///
public int EndOffset {
get { return endOffset; }
}
}
}