コード例 #1
0
 public void RemoveItem(FileSystemInfoContract target, bool recurse)
 {
     ExecuteInSemaphore(() => {
         if (!(target is ProxyFileInfoContract))
         {
             gateway.RemoveItemAsync(rootName, target.Id, recurse).Wait();
         }
     }, nameof(RemoveItem), true);
 }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
            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;
            }
コード例 #4
0
 void IDisposable.Dispose()
 {
     gateway.RemoveItemAsync(root, directory.Id, true).Wait();
 }
 public void Dispose()
 {
     gateway.RemoveItemAsync(root, directory.Id, true);
 }