C#版本提交


public void VersionEdit(IFeatureWorkspace featureWorkspace)
{
    IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("Feature_Class_Name");

    IVersion2 version = (IVersion2)featureWorkspace;
   

    //IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)version;
    IVersionEdit4 versionEdit = (IVersionEdit4)version;

    //reconcile against the default version
    if(version.HasParent() != false)
    {
        Boolean conflictsDetected = versionEdit.Reconcile4("SDE.DEFAULT", true, false, false, false);

        IVersion preReconcileVersion = versionEdit.PreReconcileVersion;
        IVersion commonAncestorVersion = versionEdit.CommonAncestorVersion;
        IVersion reconcileVersion = versionEdit.ReconcileVersion;
        IVersion startEditingVersion = versionEdit.StartEditingVersion;

        //no conflicts detected so post can be performed
        if (conflictsDetected != true && versionEdit.CanPost())
        {
            versionEdit.Post("SDE.DEFAULT");
        }
    }
}


上一篇:构建高性能.NET应用之配置高可用IIS服务器-第四篇 IIS常见问题之:工作进程回收机制(上)


下一篇:GIT03_初始化init、查看状态status、添加add、删除rm、commit提交、历史版本reflog、忽略文件gitignore(二)