protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { LoadAuthentication(context); if (EnvelopeID.Get(context) != null) { mEnvelopeID = EnvelopeID.Get(context); } else { throw new System.ArgumentException("Envelope ID is required!"); } if (DocumentID.Get(context) != null) { mDocumentID = DocumentID.Get(context); } else { throw new System.ArgumentException("Document ID is required!"); } if (OutFile.Get(context) != null) { mOutFile = OutFile.Get(context); } else { throw new System.ArgumentException("Output filepath is required!"); } GetDocumentDelegate = new Action(_DownloadDocument); return(GetDocumentDelegate.BeginInvoke(callback, state)); }