Altova XMLSpy 2024 Professional Edition

声明

GetUIModifications() as String

 

描述

GetUIModifications()方法在初始化插件期间调用,以获取定义XMLSpy的用户界面的更改的XML配置数据。此方法在第一次加载插件时调用,并在每次启动XMLSpy时调用。有关如何更改UI的详细说明,请另请参见配置XML

 

示例

Public Function IXMLSpyPlugIn_GetUIModifications() As String

  ' GetUIModifications() gets the XML file with the specified modifications of

  ' the UI from the config.xml file in the plug-in folder

  Dim strPath As String

  strPath = App.Path

 

  If Len(strPath) > 0 Then

     Dim fso As New FileSystemObject

     Dim file As file

     Set file = fso.GetFile(strPath & "\config.xml")

 

     If (Not (file Is Nothing)) Then

        Dim stream As TextStream

        Set stream = file.OpenAsTextStream(ForReading)

 

        ' this replaces the token '**path**' from the XML file with

        ' the actual installation path of the plug-in to get the image file

        Dim strMods As String

        strMods = stream.ReadAll

        strMods = Replace(strMods, "**path**", strPath)

 

        IXMLSpyPlugIn_GetUIModifications = strMods

     Else

        IXMLSpyPlugIn_GetUIModifications = ""

     End If

  End If

End Function

 

© 2017-2023 Altova GmbH