{\r
// var cancellationToken=_cts.Token;// .ThrowIfCancellationRequested();\r
\r
- if (await WaitOrAbort(cloudFile, cancellationToken))\r
+ if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))\r
return;\r
\r
\r
if (cloudFile.Name.EndsWith(".ignore", StringComparison.InvariantCultureIgnoreCase))\r
return;\r
\r
- if (!Selectives.IsSelected(cloudFile))\r
+ if (!Selectives.IsSelected(accountInfo,cloudFile))\r
return;\r
\r
\r
throw new ArgumentException("cloudFile is a directory, not a file", "cloudFile");\r
Contract.EndContractBlock();\r
\r
- if (await WaitOrAbort(cloudFile, cancellationToken))\r
+ if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))\r
return;\r
\r
var fileAgent = GetFileAgent(accountInfo);\r
ReportDownloadProgress(Path.GetFileName(localPath), 0, upHashes.Length, cloudFile.Bytes);\r
for (var i = 0; i < upHashes.Length; i++)\r
{\r
- if (await WaitOrAbort(cloudFile, cancellationToken))\r
+ if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))\r
return;\r
\r
//For every non-matching hash\r
throw new ArgumentException("cloudFile is a directory, not a file", "cloudFile");\r
Contract.EndContractBlock();\r
\r
- if (await WaitOrAbort(cloudFile, cancellationToken))\r
+ if (await WaitOrAbort(accountInfo,cloudFile, cancellationToken))\r
return;\r
\r
var localPath = FileInfoExtensions.GetProperFilePathCapitalization(filePath);\r
return AgentLocator<FileAgent>.Get(accountInfo.AccountPath);\r
}\r
\r
- private async Task<bool> WaitOrAbort(ObjectInfo cloudFile, CancellationToken token)\r
+ private async Task<bool> WaitOrAbort(AccountInfo account,ObjectInfo cloudFile, CancellationToken token)\r
{\r
token.ThrowIfCancellationRequested();\r
await UnpauseEvent.WaitAsync();\r
- var shouldAbort = !Selectives.IsSelected(cloudFile);\r
+ var shouldAbort = !Selectives.IsSelected(account,cloudFile);\r
if (shouldAbort)\r
Log.InfoFormat("Aborting [{0}]", cloudFile.Uri);\r
return shouldAbort;\r
SelectivePaths[account.AccountKey] = UrisToFilePaths(account,uris);\r
}\r
\r
- public bool IsSelected(ObjectInfo info)\r
+ public bool IsSelected(AccountInfo account,ObjectInfo info)\r
{\r
//Shared folders should NOT be synced if selective syncing is disabled\r
var isShared = info.IsShared??false;\r
if (info.StorageUri == null)\r
return true;\r
- var selectiveEnabled = IsSelectiveEnabled(info.AccountKey);\r
+ var selectiveEnabled = IsSelectiveEnabled(account.AccountKey);\r
if (!selectiveEnabled)\r
return !isShared;\r
\r
List<Uri> filterUris;\r
- return !SelectiveUris.TryGetValue(info.AccountKey, out filterUris) \r
+ return !SelectiveUris.TryGetValue(account.AccountKey, out filterUris) \r
|| filterUris.Count ==0\r
|| filterUris.Any(f => info.Uri.IsAtOrDirectlyBelow(f));\r
}\r
\r
using (StatusNotification.GetNotifier("Uploading {0}", "Finished Uploading {0}", fileInfo.Name))\r
{\r
- if (await WaitOrAbort(cloudFile, token)) \r
+ if (await WaitOrAbort(accountInfo,cloudFile, token)) \r
return;\r
\r
var fullFileName = fileInfo.GetProperCapitalization();\r
while (missingHashes.Count > 0)\r
{\r
\r
- if (await WaitOrAbort(cloudFile, token))\r
+ if (await WaitOrAbort(accountInfo,cloudFile, token))\r
return;\r
\r
\r
var buffer = new byte[accountInfo.BlockSize];\r
foreach (var missingHash in missingHashes)\r
{\r
- if (await WaitOrAbort(cloudFile, token))\r
+ if (await WaitOrAbort(accountInfo,cloudFile, token))\r
return;\r
\r
\r
}\r
}\r
\r
- private async Task<bool> WaitOrAbort(ObjectInfo cloudFile, CancellationToken token)\r
+ private async Task<bool> WaitOrAbort(AccountInfo account,ObjectInfo cloudFile, CancellationToken token)\r
{\r
token.ThrowIfCancellationRequested();\r
await UnpauseEvent.WaitAsync();\r
- var shouldAbort = !Selectives.IsSelected(cloudFile);\r
+ var shouldAbort = !Selectives.IsSelected(account,cloudFile);\r
if (shouldAbort)\r
Log.InfoFormat("Aborting [{0}]",cloudFile.Uri);\r
return shouldAbort;\r