public override void DeleteFile(File file) { if (!file.Parent.Equals(this)) { throw new ArgumentException("The specified directory could not be found"); } GoogleDriveFile googleDriveFile = file as GoogleDriveFile; if (storage.UseTrash) { FilesResource.TrashRequest request = storage.Service.Files.Trash(googleDriveFile.file.Id); request.Execute(); } else { FilesResource.DeleteRequest request = storage.Service.Files.Delete(googleDriveFile.file.Id); request.Execute(); } }
public override void DeleteDirectory(Directory directory) { if (!directory.Parent.Equals(this)) { throw new ArgumentException("The specified directory could not be found"); } GoogleDriveDirectory googleDriveDirectory = directory as GoogleDriveDirectory; if (storage.UseTrash) { FilesResource.TrashRequest request = storage.Service.Files.Trash(googleDriveDirectory.folder.Id); request.Execute(); } else { FilesResource.DeleteRequest request = storage.Service.Files.Delete(googleDriveDirectory.folder.Id); request.Execute(); } }