ArcObjects Library Reference  (GeoDatabase)    

IVersionEvents Interface

Provides access to events that occur on a version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Event OnConflictsDetected This event is fired during reconciliation, after conflicts are detected. It can be used by application developers to filter found conflicts.
Event OnReconcile This event is fired after the version is reconciled, associating it with a new database state. Applications must discard or refresh any cached row objects.
Event OnRedefineVersion This event is fired after the version is changed in place to represent a different version, associating it with a new database state. Applications must discard or refresh any cached row objects.
Event OnRefreshVersion This event is fired after the version is refreshed, associating it with a new database state. Applications must discard or refresh any cached row objects.

CoClasses that implement IVersionEvents

CoClasses and Classes Description
CadastralWorkspaceDatasetExtension (esriGeoDatabaseExtensions) A container for describing this cadastral fabric's workspace extension properties.
VersionEvents Helper coclass for working with the outbound interface IVersionEvents.
VersionEventsListener (esriSystemUtility) Helper coclass to provide IVersionEvents support to the C++ API.
[Visual Basic 6.0]
To respond to events using Visual Basic, declare a modular-level object variable of type VersionEvents using the WithEvents keyword in a class module.
Private WithEvents VersionEvents as VersionEvents

Although the object variable has been declared, it points to nothing. Initialize the object variable using the Set statement linking it to an existing VersionedWorkspace. A good place to set this is in the IEditorEvent.StartEditing event:
Private WithEvents EditEvents As Editor
Private WithEvents VersionEvents as VersionEvents
 Private m_pEditor As IEditor
 
Private Sub EditEvents_OnStartEditing()
  Set VersionEvents = m_pEditor.EditWorkspace
End Sub
Private Sub EditEvents_OnStopEditing(ByVal Save As Boolean)
  Set VersionEvents = Nothing
End Sub
Private Sub VersionEvents_OnReconcile(ByVal VersionName As String, ByVal foundConflicts As Boolean)
  If foundConflicts Then
    MsgBox "Conflicts detected."
  End If
End Sub
Set the event object variable to nothing when you are no longer interested in listening to events.  As shown in the above sample, VersionEvents is set to nothing when the IEditEvents.OnStopEditing event is fired.
 
If you wish to listen to VersionEvents from within a WorkspaceExtension , do not use the methodolgy described above. It will create a circular reference.  Instead, have your WorkspaceExtension implement the interface IVersionEvents and the VersionedWorkspace will call your implemented methods at the proper time.
Implements IWorkspaceExtension
Implements IWorkspaceExtensionControl
Implements IVersionEvents

Private Sub IVersionEvents_OnReconcile(ByVal VersionName As String, ByVal foundConflicts As Boolean)
  If foundConflicts Then
    MsgBox "Conflicts detected."
  End If
End Sub

 


Feedback Send feedback on this page