Altova Authentic 2024 Desktop

Deklaration

OnUpdateCommand(nID als long, pXMLSpy als IDispatch) als SPYUpdateAction

 

Beschreibung

Die OnUpdateCommand() Methode wird jedes Mal, wenn der Sichtbarkeitsstatus einer Schaltfläche oder eines Menübefehls definiert werden muss, aufgerufen. nID speichert die durch das ID-Element des entsprechenden UIElement definierte Befehls-ID. pXMLSpy enthält eine Referenz auf das Dispatch Interface des Application-Objekts.

 

Mögliche Rückgabewerte zum Definieren des Aktualisierungsstatus sind:

spyEnable= 1

spyDisable   = 2

spyCheck     = 4

spyUncheck   = 8

 

Beispiel

Public Function IXMLSpyPlugIn_OnUpdateCommand(ByVal nID As Long, ByVal pXMLSpy As Object) As SPYUpdateAction

  IXMLSpyPlugIn_OnUpdateCommand = spyDisable

 

  If (Not (pXMLSpy Is Nothing)) Then

     Dim objSpy As XMLSpyLib.Application

     Set objSpy = pXMLSpy

 

     If nID = 3 Or nID = 5 Then

        IXMLSpyPlugIn_OnUpdateCommand = spyEnable

     End If

     If nID = 4 Or nID = 6 Then

        If objSpy.Documents.Count > 0 Then

           IXMLSpyPlugIn_OnUpdateCommand = spyEnable

        Else

           IXMLSpyPlugIn_OnUpdateCommand = spyDisable

        End If

     End If

  End If

End Function

 

© 2017-2023 Altova GmbH