/// <see cref="DeleteEntry.Flags"/> public Builder Flags(DeleteFlags flags) { _delete.Flags = flags; return(this); }
/// <summary> /// Retrieve the hierarchy table for a folder. /// </summary> /// <param name="serverId">A 32-bit signed integer represent the Identity of server.</param> /// <param name="folderHandleIndex">The folder handle index</param> /// <param name="deleteFlags">The delete flag indicates whether checking delete.</param> /// <param name="rowCount">The row count.</param> /// <returns>Indicate the result of this ROP operation.</returns> public RopResult GetHierarchyTable(int serverId, int folderHandleIndex, DeleteFlags deleteFlags, out int rowCount) { RopResult result = RopResult.InvalidParameter; rowCount = -1; uint objHandle = this.handleContainer[folderHandleIndex]; RopGetHierarchyTableRequest getHierarchyTableRequest = new RopGetHierarchyTableRequest(); RopGetHierarchyTableResponse getHierarchyTableResponse = new RopGetHierarchyTableResponse(); getHierarchyTableRequest.RopId = 0x04; getHierarchyTableRequest.LogonId = 0x00; getHierarchyTableRequest.InputHandleIndex = 0x00; getHierarchyTableRequest.OutputHandleIndex = 0x01; // If this bit is set, the contents table lists only the soft-deleted messages. getHierarchyTableRequest.TableFlags = 0x20; getHierarchyTableResponse = (RopGetHierarchyTableResponse)this.Process(serverId, getHierarchyTableRequest, objHandle); result = (RopResult)getHierarchyTableResponse.ReturnValue; int expectedRowCount = (int)getHierarchyTableResponse.RowCount; // Add this condition to match the model logical for return result, it's better to compare. if (deleteFlags == DeleteFlags.SoftDeleteCheck && this.currentSoftDeleteRowCount + 1 == expectedRowCount) { rowCount = 1; } else if (deleteFlags == DeleteFlags.HardDeleteCheck && this.currentSoftDeleteRowCount == expectedRowCount && Common.IsRequirementEnabled(90205002, this.Site)) { rowCount = 0; } else if (deleteFlags == DeleteFlags.Initial) { rowCount = 0; } this.currentSoftDeleteRowCount = expectedRowCount; return result; }
public static RopResult GetHierarchyTable(int serverId, int folderHandleIndex, DeleteFlags deleteFlags, out int rowCount) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Get current ConnectionData value. ConnectionData currentConnection = connections[serverId]; // Create a new currentDownloadContext. AbstractUploadInfo currentUploadContext = new AbstractUploadInfo(); // Initialize the rowCount value. rowCount = -1; // Find the current Upload Context foreach (AbstractUploadInfo tempUploadContext in currentConnection.UploadContextContainer) { if (tempUploadContext.RelatedFastTransferOperation == EnumFastTransferOperation.SynchronizationImportDeletes) { currentUploadContext = tempUploadContext; } } if (folderHandleIndex < 0) { rowCount = -1; // serverHandleIndex is Invalid Parameter. return RopResult.InvalidParameter; } else { if (deleteFlags == DeleteFlags.Initial) { rowCount = 0; return RopResult.Success; } else if (deleteFlags == DeleteFlags.HardDeleteCheck) { if (requirementContainer.ContainsKey(90205002) && !requirementContainer[90205002]) { rowCount = -1; } else { rowCount = 0; } } else if (deleteFlags == DeleteFlags.SoftDeleteCheck) { rowCount = softDeleteFolderCount; } return RopResult.Success; } }
public void DeletePath(int image, string path, DeleteFlags deleteFlags) { WimLibException.CheckWimLibError(NativeMethods.DeletePath(_ptr, image, path, deleteFlags)); }
public static RopResult GetContentsTable(int serverId, int folderHandleIndex, DeleteFlags deleteFlags, out int rowCount) { // The construction conditions. Condition.IsTrue(connections.Count > 0); Condition.IsTrue(connections.Keys.Contains(serverId)); // Get current ConnectionData value. ConnectionData currentConnection = connections[serverId]; // Create a new currentDownloadContext. AbstractUploadInfo currentUploadContext = new AbstractUploadInfo(); rowCount = -1; // Find the current Upload Context foreach (AbstractUploadInfo tempUploadContext in currentConnection.UploadContextContainer) { if (tempUploadContext.RelatedFastTransferOperation == EnumFastTransferOperation.SynchronizationImportDeletes) { currentUploadContext = tempUploadContext; } } if (folderHandleIndex < 0) { rowCount = -1; // serverHandleIndex is Invalid Parameter. return RopResult.InvalidParameter; } else { if (deleteFlags == DeleteFlags.Initial) { rowCount = 0; return RopResult.Success; } else if (deleteFlags == DeleteFlags.HardDeleteCheck) { rowCount = 0; } else if (deleteFlags == DeleteFlags.SoftDeleteCheck) { rowCount = softDeleteMessageCount; if (priorOperation == MS_OXCFXICS.PriorOperation.RopSynchronizationImportMessageMove) { rowCount = 1; } } return RopResult.Success; } }