Altova XMLSpy 2024 Professional Edition

In den unten stehenden Codefragmenten (aus dem Beispiel AutomateXMLSpy) wird gezeigt, wie zwei Dateien über zwei separate Methoden, die zwei Schaltflächen der Benutzeroberfläche zugewiesen wurden, geöffnet werden. Beide Methoden bedienen sich desselben Zugriffsmechanismus auf die Application API: XMLSpy.Documents.OpenFile(string, boolean).

 

Das AutomateXMLSpy Beispiel (siehe Datei form1.cs) 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.

 

Codefragment

 

 // Handler for the "Open OrgChart.pxf" button

       private void openOrgChart_Click(object sender, EventArgs e)

       {

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

           StartXMLSpy_Click(null, null);

 

           // Open a file from the Examples folder installed with the product

           XMLSpy.Documents.OpenFile(strExamplesFolder + "OrgChart.pxf", false);

       }

 

       // Handler for the "Open ExpReport.xml" button

       private void openExpReport_Click(object sender, EventArgs e)

       {

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

           StartXMLSpy_Click(null, null);

 

           // Open a file from the Examples folder installed with the product

           XMLSpy.Documents.OpenFile(strExamplesFolder + "ExpReport.xml", false);

       }

 

 

Die zuletzt geöffnete Datei ist die aktive Datei.

 

© 2018-2024 Altova GmbH