Ejemplo n.º 1
0
        public string UploadFileEntry(Stream stream, string cloudDirName = "/Invoices/")
        {
            IResource res = new StreamResource(stream);
            var fileEntry = this.dropbox.UploadFileAsync(res, cloudDirName).Result;

            var shareableLink = dropbox.GetShareableLinkAsync(fileEntry.Path).Result;
            return shareableLink.Url;
        }
 public void Instantiation()
 {
     using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes("A temporary resource.")))
     {
         StreamResource res = new StreamResource(stream);
         Assert.IsTrue(res.IsOpen);
         Assert.IsNull(res.Uri);
         Assert.IsNotNull(res.GetStream());
     }
 }
 public void ReadStreamMultipleTimes()
 {
     using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes("A temporary resource.")))
     {
         StreamResource res = new StreamResource(stream);
         Assert.IsTrue(res.IsOpen);
         Assert.IsNull(res.Uri);
         res.GetStream();
         res.GetStream();
     }
 }