Exemplo n.º 1
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_tempFileAttachments != null)
         {
             _tempFileAttachments.Dispose();
             _tempFileAttachments = null;
         }
     }
 }
Exemplo n.º 2
0
        TempFileCollection IFilesStorageRepository.SaveTempFile(string fileContents, string fileName)
        {
            var tempCollection = new TempFileCollection();

            try
            {
                using (var stream = tempCollection.AddNewTempFile(fileName))
                {
                    using (var writer = new StreamWriter(stream))
                    {
                        writer.Write(fileContents);
                    }
                }
            }
            catch
            {
                tempCollection.Dispose();
                throw;
            }

            return(tempCollection);
        }