Attach to events on version Manager dialog with Arcobjects

261
0
12-09-2019 05:55 AM
Harald_ØysteinLund1
Esri Contributor

Is there anybody out there that have been able to hook up or wire up event delegates on the VersionManager Dialog in ArcMap?

The only sample I have found is this, but SetupVersionmanagerEvets reqiures an instance of IVersionManager, and that's logical. The question is how to get this instance when user clicks that button in the GUI? 

class EventList {   public IVersionManagerEvents_OnVersionCreatedEventHandler dOnVersionCreatedE;   public void SetupVersionManagerEvents(IVersionManager versionManager)   {     IVersionManagerEvents_Event versionManagerEvent =        (IVersionManagerEvents_Event)versionManager;      //Wire OnReconcile event.    dOnVersionCreatedE = new IVersionManagerEvents_OnVersionCreatedEventHandler       (versionManagerEvents_OnVersionCreated);     versionManagerEvent.OnVersionCreated += dOnVersionCreatedE;   }    //Event handler method.  private void versionManagerEvents_OnVersionCreated(IVersion version)   {     string versionName = version.VersionName;     MessageBox.Show("Created " + versionName);   } }
0 Kudos
0 Replies