I am trying to understand Esri example of reconciling and post with C#. Could someone give me some hints or point me in the right direction. The reconcile and post in Arcmap toolbox has edit version and target version as optional. Is a variable in this code related to a sde connection?
public void ReconcileandPost(IVersion editVersion, IVersion targetVersion)
{
IMultiuserWorkspaceEdit muWorkspaceEdit = (IMultiuserWorkspaceEdit)editVersion;
IWorkspaceEdit workspaceEdit = (IWorkspaceEdit2)editVersion;
IVersionEdit4 versionEdit = (IVersionEdit4)workspaceEdit;
if (muWorkspaceEdit.SupportsMultiuserEditSessionMode(esriMultiuserEditSessionMode.esriMESMVersioned))
{
muWorkspaceEdit.StartMultiuserEditing(esriMultiuserEditSessionMode.esriMESMVersioned);
//Reconcile with the target version.
bool conflicts = versionEdit.Reconcile4(targetVersion.VersionName, true, false, false, false);
if (conflicts) MessageBox.Show(" Conflicts Detected ");
else MessageBox.Show(" No Conflicts Detected ");
workspaceEdit.StartEditOperation();
//Post to the target version.
if (versionEdit.CanPost()) versionEdit.Post(targetVersion.VersionName);
workspaceEdit.StopEditOperation();
workspaceEdit.StopEditing(true);
}
}
No comments:
Post a Comment