public void RemoveXPathNodeTextMarkers()
		{
			foreach (IViewContent view in workbench.ViewContentCollection) {
				ITextEditorProvider textEditorProvider = view as ITextEditorProvider;
				if (textEditorProvider != null) {
					XPathNodeTextMarker marker = new XPathNodeTextMarker(textEditorProvider.TextEditor.Document);
					marker.RemoveMarkers();
				}
			}
		}
 public void RemoveXPathNodeTextMarkers()
 {
     foreach (IViewContent view in workbench.ViewContentCollection)
     {
         ITextEditor textEditor = view.GetService <ITextEditor>();
         if (textEditor != null)
         {
             XPathNodeTextMarker.RemoveMarkers(textEditor);
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Removes all the XPath Node markers from all the open documents.
 /// </summary>
 public void RemoveXPathNodeTextMarkers()
 {
     foreach (IViewContent view in WorkbenchSingleton.Workbench.ViewContentCollection)
     {
         ITextEditorControlProvider textEditorProvider = view as ITextEditorControlProvider;
         if (textEditorProvider != null)
         {
             XPathNodeTextMarker.RemoveMarkers(textEditorProvider.TextEditorControl.Document.MarkerStrategy);
             textEditorProvider.TextEditorControl.Refresh();
         }
     }
 }
Exemplo n.º 4
0
 public void RemoveXPathNodeTextMarkers()
 {
     foreach (IViewContent view in workbench.ViewContentCollection)
     {
         ITextEditorProvider textEditorProvider = view as ITextEditorProvider;
         if (textEditorProvider != null)
         {
             XPathNodeTextMarker marker = new XPathNodeTextMarker(textEditorProvider.TextEditor.Document);
             marker.RemoveMarkers();
         }
     }
 }
		public void Init()
		{
			string xml = "<root><foo/></root>";
			XPathQuery query = new XPathQuery(xml);
			XPathNodeMatch[] nodes = query.FindNodes("//root");
			
			IDocument doc = MockTextMarkerService.CreateDocumentWithMockService();
			doc.Text = xml;
			XPathNodeTextMarker xpathNodeMarker = new XPathNodeTextMarker(doc);
			xpathNodeMarker.AddMarkers(nodes);
			
			ITextMarkerService service = doc.GetService(typeof(ITextMarkerService)) as ITextMarkerService;
			markers = new List<ITextMarker>(service.TextMarkers);
			
			// Remove markers.
			xpathNodeMarker.RemoveMarkers();
			markersAfterRemove = new List<ITextMarker>(service.TextMarkers);
			
			xpathNodeTextMarker = markers[0];
		}
Exemplo n.º 6
0
        void RunXPathQuery()
        {
            XmlView xmlView = XmlView.ActiveXmlView;

            if (xmlView == null)
            {
                return;
            }

            try {
                fileName = xmlView.File.FileName;

                // Clear previous XPath results.
                ClearResults();
                XPathNodeTextMarker.RemoveMarkers(xmlView.TextEditor.Document);

                // Run XPath query.
                XPathQuery       query = new XPathQuery(xmlView.TextEditor, GetNamespaces());
                XPathNodeMatch[] nodes = query.FindNodes(xpathComboBox.Text);
                if (nodes.Length > 0)
                {
                    AddXPathResults(nodes);
                    XPathNodeTextMarker marker = new XPathNodeTextMarker(xmlView.TextEditor.Document);
                    marker.AddMarkers(nodes);
                }
                else
                {
                    AddNoXPathResult();
                }
                AddXPathToHistory();
            } catch (XPathException xpathEx) {
                AddErrorResult(xpathEx);
            } catch (XmlException xmlEx) {
                AddErrorResult(xmlEx);
            } finally {
                BringResultsTabToFront();
            }
        }
Exemplo n.º 7
0
        void RunXPathQuery()
        {
            XmlView view = XmlView.ActiveXmlView;

            if (view == null)
            {
                return;
            }

            try {
                MarkerStrategy markerStrategy = view.TextEditorControl.Document.MarkerStrategy;
                fileName = view.PrimaryFileName;

                // Clear previous XPath results.
                ClearResults();
                XPathNodeTextMarker.RemoveMarkers(markerStrategy);

                // Run XPath query.
                XPathNodeMatch[] nodes = view.SelectNodes(xPathComboBox.Text, GetNamespaces());
                if (nodes.Length > 0)
                {
                    AddXPathResults(nodes);
                    XPathNodeTextMarker.AddMarkers(markerStrategy, nodes);
                }
                else
                {
                    AddNoXPathResult();
                }
                AddXPathToHistory();
            } catch (XPathException xpathEx) {
                AddErrorResult(xpathEx);
            } catch (XmlException xmlEx) {
                AddErrorResult(xmlEx);
            } finally {
                BringResultsTabToFront();
                view.TextEditorControl.Refresh();
            }
        }
Exemplo n.º 8
0
		void RunXPathQuery()
		{
			XmlView xmlView = XmlView.ActiveXmlView;
			if (xmlView == null) {
				return;
			}
			
			try {
				fileName = xmlView.File.FileName;
				
				// Clear previous XPath results.
				ClearResults();
				XPathNodeTextMarker marker = new XPathNodeTextMarker(xmlView.TextEditor.Document);
				marker.RemoveMarkers();
				
				// Run XPath query.
				XPathQuery query = new XPathQuery(xmlView.TextEditor, GetNamespaces());
				XPathNodeMatch[] nodes = query.FindNodes(xpathComboBox.Text);
				if (nodes.Length > 0) {
					AddXPathResults(nodes);
					marker.AddMarkers(nodes);
				} else {
					AddNoXPathResult();
				}
				AddXPathToHistory();
			} catch (XPathException xpathEx) {
				AddErrorResult(xpathEx);
			} catch (XmlException xmlEx) {
				AddErrorResult(xmlEx);
			} finally {
				BringResultsTabToFront();
			}
		}