public void RemoveItem(FileSystemInfoContract target, bool recurse) { ExecuteInSemaphore(() => { if (!(target is ProxyFileInfoContract)) { gateway.RemoveItemAsync(rootName, target.Id, recurse).Wait(); } }, nameof(RemoveItem), true); }
public void RemoveItem(FileSystemInfoContract target, bool recurse) { try { gateway.RemoveItemAsync(rootName, target.Id, recurse).Wait(); } catch (AggregateException ex) when(ex.InnerExceptions.Count == 1) { throw ex.InnerExceptions[0]; } finally { InvalidateDrive(); } }
private TestDirectoryFixture(IAsyncCloudGateway gateway, RootName root, string apiKey, IDictionary <string, string> parameters, string path) { this.gateway = gateway; this.root = root; var rootDirectory = gateway.GetRootAsync(root, apiKey, parameters).Result; var residualDirectory = gateway.GetChildItemAsync(root, rootDirectory.Id).Result.SingleOrDefault(f => f.Name == path) as DirectoryInfoContract; if (residualDirectory != null) { gateway.RemoveItemAsync(root, residualDirectory.Id, true).Wait(); } directory = gateway.NewDirectoryItemAsync(root, rootDirectory.Id, path).Result; }
void IDisposable.Dispose() { gateway.RemoveItemAsync(root, directory.Id, true).Wait(); }
public void Dispose() { gateway.RemoveItemAsync(root, directory.Id, true); }