Skip to content

Commit 61f9667

Browse files
committed
Fest Workshop
- Added sample events to the object model.
1 parent 1bdaf73 commit 61f9667

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,14 @@ try
264264
CancellationToken token = cancellationTokenSource.Token;
265265

266266
// Regardless of transfer client, the approach below remains the same.
267+
268+
// The transfer context object provides several events and supplied to the transfer requests below.
269+
TransferContext context = new TransferContext();
270+
context.TransferPathIssue += (sender, args) => { };
271+
context.TransferRequest += (sender, args) => { };
272+
context.TransferPathProgress += (sender, args) => { };
273+
context.TransferJobRetry += (sender, args) => { };
274+
context.TransferStatistics += (sender, args) => { };
267275

268276
// Get the same workspace specified above to get the default file share.
269277
Workspace workspace = await client.GetWorkspaceAsync(token).ConfigureAwait(false);
@@ -278,7 +286,7 @@ try
278286
};
279287

280288
// Add all upload transfer path objects to the request.
281-
TransferRequest uploadRequest = TransferRequest.ForUpload(localSourcePath);
289+
TransferRequest uploadRequest = TransferRequest.ForUpload(localSourcePath, context);
282290

283291
// Submit the request and await completion.
284292
ITransferResult uploadResult = await client.TransferAsync(uploadRequest, token).ConfigureAwait(false);
@@ -297,7 +305,7 @@ try
297305
};
298306

299307
// Add all download transfer path objects to the request, submit the request, and await completion.
300-
TransferRequest downloadRequest = TransferRequest.ForDownload(remoteSourcePath);
308+
TransferRequest downloadRequest = TransferRequest.ForDownload(remoteSourcePath, context);
301309
ITransferResult downloadResult = await client.TransferAsync(downloadRequest, token).ConfigureAwait(false);
302310

303311
if (downloadResult.Status != TransferStatus.Successful)

0 commit comments

Comments
 (0)