static void UpdateDocsBuffer(CrudAPI api, byte[][] buffers, UserDocsClient[] multiDocs, int Cnt)
        {
            for (int i = 0; i < Cnt; i++)
            {
                var updateDoc = multiDocs[i];
                updateDoc._Data = buffers[i];

                var org = new UserDocsClient();
                org.Copy(updateDoc);
                org._Data    = updateDoc._Data;
                multiDocs[i] = org;
            }
            uploadingDocs = Cnt;
            UpdateBuffersOne(api, multiDocs, 0);
        }
        static void UpdateBuffersOne(CrudAPI api, UserDocsClient[] multiVouchers, int i)
        {
            var vouchersClient = multiVouchers[i];

            if (vouchersClient == null)
            {
                for (int j = 0; (j < multiVouchers.Length); j++)
                {
                    if (multiVouchers[j] != null)
                    {
                        UpdateBuffersOne(api, multiVouchers, j);
                        return;
                    }
                }
                uploadingDocs = 0;
                return;
            }

            var org = new UserDocsClient();

            org.Copy(vouchersClient);

            int cnt = 0;

retry:

            try
            {
                var tsk = api.Update(org, vouchersClient);
                tsk.ContinueWith((e) =>
                {
                    int next;
                    if (!e.IsFaulted)
                    {
                        multiVouchers[i] = null;
                        next             = i + 1; // go to next
                    }
                    else
                    {
                        next = i;
                    }

                    var remaining = multiVouchers.Length - next;
                    if (remaining > 0)
                    {
                        uploadingDocs = remaining;
                        UpdateBuffersOne(api, multiVouchers, next);
                    }
                    else
                    {
                        uploadingDocs = 0;
                    }
                }, TaskContinuationOptions.None);

#if !SILVERLIGHT
                var tskw = Task.Delay(60000);
                tskw.ContinueWith((e) =>
                {
                    if (multiVouchers[i] != null)
                    {
                        if ((i + 1) < multiVouchers.Length)
                        {
                            UpdateBuffersOne(api, multiVouchers, i + 1);
                        }

                        Task.Delay(5000).ContinueWith((x) =>
                        {
                            UpdateBuffersOne(api, multiVouchers, i);
                        }, TaskContinuationOptions.None);
                    }
                }, TaskContinuationOptions.None);
#endif
            }
            catch (Exception ex)
            {
                if (++cnt < 3)
                {
                    goto retry;
                }
                throw ex;
            }
        }