コード例 #1
0
ファイル: Communication.cs プロジェクト: formist/LinkMe
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_tempFileAttachments != null)
         {
             _tempFileAttachments.Dispose();
             _tempFileAttachments = null;
         }
     }
 }
コード例 #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);
        }