Ejemplo n.º 1
0
        private void CopyAsync(CloudBlobContainer container, string blobName, int copy)
        {
            var            source = container.GetBlobReference(GetSource(blobName, copy));
            var            target = container.GetBlobReference(GetTarget(blobName, copy));
            CopyAsyncState state  = new CopyAsyncState()
            {
                Container = container, BlobName = blobName, Target = target, Copy = copy - 1
            };

            target.BeginCopyFromBlob(source, CopyAsyncCompletedCallback, state);
        }
Ejemplo n.º 2
0
        private void CopyAsyncCompletedCallback(IAsyncResult result)
        {
            CopyAsyncState state = (CopyAsyncState)result.AsyncState;

            try
            {
                state.Target.EndCopyFromBlob(result);
            }
            catch { }
            if (state.Copy > 0)
            {
                CopyAsync(state.Container, state.BlobName, state.Copy);
            }
        }