AnsweredAssumed Answered

Attach to events on version Manager dialog with Arcobjects

Question asked by harald.lundgeodata-no-esridist Employee on Dec 9, 2019

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);   } }