/// <summary>
 /// Adds a single marker for the XPathNodeMatch.
 /// </summary>
 public static void AddMarker(MarkerStrategy markerStrategy, XPathNodeMatch node)
 {
     if (node.HasLineInfo() && node.Value.Length > 0) {
         LineSegment lineSegment = markerStrategy.Document.GetLineSegment(node.LineNumber);
         markerStrategy.AddMarker(new XPathNodeTextMarker(lineSegment.Offset + node.LinePosition, node));
     }
 }
		string GetLineNumberIfHasLineInfo(XPathNodeMatch nodeMatch)
		{
			if (nodeMatch.HasLineInfo()) {
				return nodeMatch.LineNumber.ToString();
			}
			return "null";
		}
 /// <summary>
 /// Adds a single marker for the XPathNodeMatch.
 /// </summary>
 public static void AddMarker(MarkerStrategy markerStrategy, XPathNodeMatch node)
 {
     if (node.HasLineInfo() && node.Value.Length > 0)
     {
         LineSegment lineSegment = markerStrategy.Document.GetLineSegment(node.LineNumber);
         markerStrategy.AddMarker(new XPathNodeTextMarker(lineSegment.Offset + node.LinePosition, node));
     }
 }
 public void AddMarker(XPathNodeMatch node)
 {
     if (node.HasLineInfo() && node.Value.Length > 0) {
         int offset = document.GetOffset(node.LineNumber + 1, node.LinePosition + 1);
         if (markerService != null) {
             ITextMarker marker = markerService.Create(offset, node.Value.Length);
             marker.Tag = typeof(XPathNodeTextMarker);
             marker.BackgroundColor = MarkerBackColor;
         }
     }
 }
		public bool AreEqual(XPathNodeMatch lhs, XPathNodeMatch rhs)
		{
			reason.Clear();
			
			foreach (PropertyInfo property in typeof(XPathNodeMatch).GetProperties()) {
				ComparePropertyValues(property, lhs, rhs);
			}
			if (lhs.HasLineInfo() != rhs.HasLineInfo()) {
				AppendPropertyDoesNotMatchMessage("LineNumber", GetLineNumberIfHasLineInfo(lhs), GetLineNumberIfHasLineInfo(rhs));
			}
			return !HasReasonForNotMatching;
		}
Beispiel #6
0
 public void AddMarker(XPathNodeMatch node)
 {
     if (node.HasLineInfo() && node.Value.Length > 0)
     {
         int offset = document.PositionToOffset(node.LineNumber + 1, node.LinePosition + 1);
         if (markerService != null)
         {
             ITextMarker marker = markerService.Create(offset, node.Value.Length);
             marker.Tag             = typeof(XPathNodeTextMarker);
             marker.BackgroundColor = MarkerBackColor;
         }
     }
 }