public void ShowVersionChangesWindow(string sourceVersionName, string targetVersionName) { try { UtilityMethods utilMethods = new UtilityMethods(); IVersion sourceVersion = utilMethods.GetVersionByName(sourceVersionName); IVersion targetVersion = utilMethods.GetVersionByName(targetVersionName); IMap pMap = (Common.GlobalFunction.Instance.G_PApps.Document as IMxDocument).FocusMap; IActiveView pActiveView = pMap as IActiveView; ITrackCancel trackCancel = new CancelTrackerClass(); IVersionChangesWindow pVersionChngesWin = new VersionChangesWindow(); pVersionChngesWin.Initialize(Common.GlobalFunction.Instance.G_PApps.hWnd, pMap, sourceVersion, targetVersion, pActiveView.FullExtent, trackCancel); pVersionChngesWin.Visible = true; } catch (Exception ex) { } }
Solved! Go to Solution.
public IVersion GetVersionByName(string versionName) { try { IDocumentDatasets doc = pMxDoc as IDocumentDatasets; IVersionedWorkspace ver_ws = doc.Datasets.Next().Workspace as IVersionedWorkspace; return ver_ws.FindVersion(versionName); } catch (Exception ex) { return null; } }
public IVersion GetVersionByName(string versionName) { try { IDocumentDatasets doc = pMxDoc as IDocumentDatasets; IVersionedWorkspace ver_ws = doc.Datasets.Next().Workspace as IVersionedWorkspace; return ver_ws.FindVersion(versionName); } catch (Exception ex) { return null; } }