public bool CheckOutProject(string strLocalPath, string strRemotePath, string Comment) { if (!(this.bConnected && this.bLogin)) { return(false); } Boolean Cancelled; String ResultDescription; String ProjectToCheckout = SAWCommon.ConvertPath(strRemotePath); String LocalDirectory = strLocalPath; var OperationResultSet = new SAWHOperationResultSet(); var MergeParam = new SAWHDiffMergeParam(); if (0 != sdkObject.CheckoutProject(ProjectToCheckout, LocalDirectory, Comment, false, false, false, Enum_ModifiedFileHandling.Enum_AskModifiedFile, Enum_EOL.Enum_EOLNative, Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_SetLocalFileTime.Enum_SetLocalFileTimeCurrent, MergeParam, out Cancelled, out ResultDescription, out OperationResultSet)) { return(false); } else { return(!Cancelled); } }
public bool CheckOutFiles(string strLocalPath, string strRemotePath) { if (!(this.bConnected && this.bLogin)) { return(false); } bool Cancelled; string ResultDescription; var CheckoutFileSet = new SAWHCheckoutFileSet(); var CheckoutFile = new SAWHCheckoutFile(); var OperationResultSet = new SAWHOperationResultSet(); var MergeParam = new SAWHDiffMergeParam(); CheckoutFile.FileToCheckout = SAWCommon.ConvertPath(strRemotePath); CheckoutFile.LocalFileName = strLocalPath; CheckoutFileSet.Add(CheckoutFile); if (0 != sdkObject.CheckoutFiles(CheckoutFileSet, true, "lock", true, Enum_ModifiedFileHandling.Enum_ReplaceModifiedFile, Enum_EOL.Enum_EOLNative, Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_SetLocalFileTime.Enum_SetLocalFileTimeCurrent, MergeParam, out Cancelled, out ResultDescription, out OperationResultSet)) { return(false); } else { return(!Cancelled); } }
public bool UndoCheckoutFiles(string strRemoteFile) { if (!(this.bConnected && this.bLogin)) { return(false); } bool Cancelled; string ResultDescription; var undoCheckoutFileSet = new SAWHUndoCheckoutFileSet(); var undoCheckoutFile = new SAWHUndoCheckoutFile(); var OperationResultSet = new SAWHOperationResultSet(); undoCheckoutFile.FileToUndo = SAWCommon.ConvertPath(strRemoteFile); undoCheckoutFile.LocalFileName = ""; undoCheckoutFileSet.Add(undoCheckoutFile); if (0 != sdkObject.UndoCheckoutFiles(undoCheckoutFileSet, Enum_LocalFileHandling.Enum_LeaveLocalFile, Enum_UndoCheckOutChangedFileHandling.Enum_UndoCheckOutChangeFile, Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_EOL.Enum_EOLNative, true, Enum_SetLocalFileTime.Enum_SetLocalFileTimeCurrent, out Cancelled, out ResultDescription, out OperationResultSet)) { return(false); } else { return(!Cancelled); } }
public bool CheckInProject(string strLocalPath, string strRemotePath, string Comment) { if (!(this.bConnected && this.bLogin)) { return(false); } Boolean Cancelled; String ResultDescription; String ProjectToCheckin = SAWCommon.ConvertPath(strRemotePath); String LocalDirectory = strLocalPath; var OperationResultSet = new SAWHOperationResultSet(); var MergeParam = new SAWHDiffMergeParam(); if (0 != sdkObject.CheckInProject(ProjectToCheckin, LocalDirectory, false, false, false, false, Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_EOL.Enum_EOLNative, false, Enum_SetLocalFileTime.Enum_SetLocalFileTimeCurrent, Enum_CheckinUnchangedFileHandling.Enum_AskCheckinUnchangedFile, Comment, MergeParam, out Cancelled, out ResultDescription, out OperationResultSet)) { return(false); } else { bool bSucceed = true; foreach (SAWHOperationResult result in OperationResultSet) { if (result.OperationResult != 0) { bSucceed = false; break; } } return(bSucceed && !Cancelled); } }
public bool DeleteFile(string strRemotePath) { Boolean Cancelled; string ResultDescription; var OperationResultSet = new SAWHOperationResultSet(); var fileset = new SAWHDeleteFileSet(); fileset.Add(SAWCommon.ConvertPath(strRemotePath)); if (0 != sdkObject.DeleteFiles(fileset, false, out Cancelled, out ResultDescription, out OperationResultSet)) {/* * if(ResultDescription.Contains("already")) * return true; * else*/ return(false); } else { bool bSucceed = true; foreach (SAWHOperationResult result in OperationResultSet) { if (result.OperationResult != 0) { bSucceed = false; break; } } return(bSucceed && !Cancelled); } }
public bool AddFile(string strLocalPath, string strRemotePath, string Comment) { if (!(this.bConnected && this.bLogin)) { return(false); } var AddFileSet = new SAWHAddFileSet(); Boolean Cancelled; string ResultDescription; var OperationResultSet = new SAWHOperationResultSet(); var file = new SAWHAddFile(); file.FileType = Enum_FileType.Enum_Autodetect; file.LocalFileName = strLocalPath; file.RemoteFileName = SAWCommon.ConvertPath(strRemotePath); AddFileSet.Add(file); bool bAddSucceed = true; if (0 != sdkObject.AddFiles(AddFileSet, true, Comment, Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_SetLocalFileTime.Enum_SetLocalFileTimeCurrent, false, out Cancelled, out ResultDescription, out OperationResultSet)) { bAddSucceed = false; } else { bAddSucceed = !Cancelled; } foreach (SAWHOperationResult result in OperationResultSet) { if (result.OperationResult != 0) { bAddSucceed = false; break; } } if (!bAddSucceed) { if (CheckOutFiles(strLocalPath, strRemotePath)) { bool ret = CheckInFiles(strLocalPath, strRemotePath, Comment); if (!ret) { UndoCheckoutFiles(strRemotePath); } return(ret); } } else { return(true); } return(false); }
public bool CheckInFiles(string strLocalPath, string strRemotePath, string Comment) { bool Cancelled; string ResultDescription; var CheckinFileSet = new SAWHCheckinFileSet(); var CheckinFile = new SAWHCheckinFile(); var OperationResultSet = new SAWHOperationResultSet(); var MergeParam = new SAWHDiffMergeParam(); CheckinFile.FileToCheckin = SAWCommon.ConvertPath(strRemotePath); CheckinFile.LocalFileName = strLocalPath; CheckinFileSet.Add(CheckinFile); if (0 != sdkObject.CheckInFiles(CheckinFileSet, false, false, Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_EOL.Enum_EOLNative, false, true, Enum_SetLocalFileTime.Enum_SetLocalFileTimeCurrent, Enum_CheckinUnchangedFileHandling.Enum_CheckinUnchangedFile, Comment, MergeParam, out Cancelled, out ResultDescription, out OperationResultSet)) { return(false); } else { return(!Cancelled); } }