Altova XMLSpy 2024 Enterprise Edition

Im unten gezeigten Codefragment (aus dem Beispiel AutomateXMLSpy; siehe Datei form1.cs) wird gezeigt, wie man durch offene Dokumente iteriert. Anschließend wird in der Iterationsschleife eine Bedingung überprüft und es wird zwischen der Text- und der Authentic-Ansicht gewechselt.

 

 // Handler for the "Toggle view mode" button

       private void toggleView_Click(object sender, EventArgs e)

       {

           // Make sure there's a running XMLSpy instance, and that it's visible

           StartXMLSpy_Click(null, null);

 

           // Iterate through open documents and toggle current view between text and authentic view.

           foreach (XMLSpyLib.Document doc in XMLSpy.Documents)

               if (doc.CurrentViewMode == XMLSpyLib.SPYViewModes.spyViewText)

                   doc.SwitchViewMode(XMLSpyLib.SPYViewModes.spyViewAuthentic);

               else

                   doc.SwitchViewMode(XMLSpyLib.SPYViewModes.spyViewText);

       }

 

 

Das Beispiel AutomateXMLSpy befindet sich im Unterordner C# des Ordners API Examples:

 

 

Windows 7, Windows 8, Windows 10, Windows 11

C:\Benutzer\<Benutzername>\Dokumente\
Altova\XMLSpy\2024\Examples

 

Sie können das Projekt von Visual Studio 2012/2013/2015/2017/2019/2022 aus kompilieren und ausführen.

 

© 2017-2023 Altova GmbH