Browse Source

Fix Hide XPath Results menu option.

ITextMarkerService is not returned by IViewContent.GetService()
but is available from ITextEditor.
newNRvisualizers
Matt Ward 13 years ago
parent
commit
4bbd7f609d
  1. 5
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/RemoveXPathHighlightingCommand.cs
  2. 3
      src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs

5
src/AddIns/DisplayBindings/XmlEditor/Project/Src/RemoveXPathHighlightingCommand.cs

@ -32,7 +32,10 @@ namespace ICSharpCode.XmlEditor @@ -32,7 +32,10 @@ namespace ICSharpCode.XmlEditor
public void RemoveXPathNodeTextMarkers()
{
foreach (IViewContent view in workbench.ViewContentCollection) {
XPathNodeTextMarker.RemoveMarkers(view);
ITextEditor textEditor = view.GetService<ITextEditor>();
if (textEditor != null) {
XPathNodeTextMarker.RemoveMarkers(textEditor);
}
}
}
}

3
src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs

@ -179,6 +179,9 @@ namespace XmlEditor.Tests.Utils @@ -179,6 +179,9 @@ namespace XmlEditor.Tests.Utils
public object GetService(Type serviceType)
{
if (serviceType == typeof(ITextEditor)) {
return this;
}
return document.GetService(serviceType);
}

Loading…
Cancel
Save