예제 #1
0
        public Task <Stream> GetTemplate(PdfDocType docType)
        {
            var tcs = new TaskCompletionSource <Stream>();

            try
            {
                var fileName = "";
                if (docType == PdfDocType.FormFill1)
                {
                    fileName = "formfill.pdf";
                }

                var fs = File.Open(Path.Combine("Documents", fileName), FileMode.Open);

                tcs.SetResult(fs);
            }
            catch (Exception e)
            {
                tcs.SetException(e);
            }
            return(tcs.Task);
        }
        public Task<Stream> GetTemplate(PdfDocType docType)
        {
            var tcs = new TaskCompletionSource<Stream>();

            try
            {
                var fileName = "";
                if (docType == PdfDocType.FormFill1)
                {
                    fileName = "formfill.pdf";
                }

                var fs = File.Open(Path.Combine("Documents", fileName), FileMode.Open);

                tcs.SetResult(fs);
            }
            catch (Exception e)
            {
                tcs.SetException(e);
            }
            return tcs.Task;
        }