private bool method_8(IVersionEdit iversionEdit_0, string string_0, bool bool_2, bool bool_3) { bool flag = true; try { if (iversionEdit_0.Reconcile(string_0)) { this.method_10(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } else if (iversionEdit_0.CanPost() && bool_2) { iversionEdit_0.Post(string_0); this.method_10(iversionEdit_0 as IWorkspaceEdit, true); if (!bool_3) { } } else { this.method_10(iversionEdit_0 as IWorkspaceEdit, true); } if (!flag) { } } catch { this.method_10(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } return(flag); }
private bool ReconcileVersionFindConflicts(IFeatureWorkspace pFeatureWorkspace, string strTargetVersion) { try { bool flag = false; IVersionEdit edit = pFeatureWorkspace as IVersionEdit; edit.CanPost(); if (edit.Reconcile(strTargetVersion)) { IVersion startEditingVersion = edit.StartEditingVersion; IVersion preReconcileVersion = edit.PreReconcileVersion; IVersion commonAncestorVersion = edit.CommonAncestorVersion; IVersion reconcileVersion = edit.ReconcileVersion; IEnumConflictClass conflictClasses = edit.ConflictClasses; conflictClasses.Reset(); for (IConflictClass class3 = conflictClasses.Next(); class3 != null; class3 = conflictClasses.Next()) { IDataset dataset = (IDataset)class3; if (class3.HasConflicts) { flag = true; string str = dataset.Name + ":"; IEnumIDs iDs = class3.UpdateUpdates.IDs; iDs.Reset(); int num = iDs.Next(); while (num != -1) { str = str + num.ToString() + ";"; num = iDs.Next(); } iDs = class3.DeleteUpdates.IDs; iDs.Reset(); num = iDs.Next(); while (num != -1) { str = str + num.ToString() + ";"; num = iDs.Next(); } iDs = class3.UpdateDeletes.IDs; iDs.Reset(); for (num = iDs.Next(); num != -1; num = iDs.Next()) { str = str + num.ToString() + ";"; } MessageBox.Show("发现冲突," + str, "版本编辑", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show(dataset.Name + " Does Not Have Conflicts", "版本编辑", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } } return(flag); } catch (Exception exception) { this.mErrOpt.ErrorOperate(this.mSubSysName, "ShapeEdit.Editor", "ReconcileVersionFindConflicts", exception.GetHashCode().ToString(), exception.Source, exception.Message, "", "", ""); return(false); } }
/// <summary> /// 提交当前版本(经过仲裁) /// </summary> /// <param name="pWorkspace">工作区</param> /// <param name="sVersion">父版本名称</param> public static void PostVerison(IWorkspace pWorkspace, string sVersion) { IVersion pVersion = (IVersion)pWorkspace; if (!IsLocked(pVersion)) { throw new Exception("不能提交数据到父版本,其它用户正在编辑"); } IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pVersion; if (!pWorkspaceEdit.IsBeingEdited()) { throw new Exception("请开始编辑会话"); } IVersionEdit pVersionEdit = (IVersionEdit)pVersion; IVersionInfo pVersionInfo = pVersion.VersionInfo; try { string sParentName = pVersionInfo.VersionName; bool bConflicts = pVersionEdit.Reconcile(sParentName); if (bConflicts) { pWorkspaceEdit.StopEditing(true); } else { if (pVersionEdit.CanPost()) { pVersionEdit.Post(sParentName); pWorkspaceEdit.StopEditing(true); } else { pWorkspaceEdit.StopEditing(true); // false //MessageBox.Show("不能提交数据到父版本[" + sParentName + "]"); } } } catch (Exception ex) { throw ex; } finally { if (pWorkspaceEdit.IsBeingEdited()) { pWorkspaceEdit.StopEditing(true); // false } pWorkspaceEdit.StartEditing(true); } }
private bool method_4(IVersionEdit iversionEdit_0, string string_0, bool bool_0, bool bool_1) { bool flag = true; IVersion version = iversionEdit_0 as IVersion; this.method_10(version, 0); try { if (this.method_11(iversionEdit_0 as IVersion)) { flag = false; } else { this.method_5(iversionEdit_0 as IWorkspaceEdit); this.txtMessage.Text = "正在将版本 " + version.VersionName + " 合并到版本 " + string_0; if (iversionEdit_0.Reconcile(string_0)) { this.txtMessage.Text = "在合并版本 " + version.VersionName + " 到版本 " + string_0 + " 时发现冲突"; this.method_6(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } else if (iversionEdit_0.CanPost() && bool_0) { this.txtMessage.Text = "合并 " + version.VersionName; iversionEdit_0.Post(string_0); this.method_6(iversionEdit_0 as IWorkspaceEdit, true); if (bool_1) { this.method_7(iversionEdit_0 as IVersion); } } else { this.method_6(iversionEdit_0 as IWorkspaceEdit, true); } } if (flag) { this.method_10(version, 2); return(flag); } this.method_10(version, 1); } catch { this.method_6(iversionEdit_0 as IWorkspaceEdit, false); flag = false; } return(flag); }