Exemplo n.º 1
0
        public void Dispose()
        {
            if (SourceReader != null)
            {
                SourceReader.Close();
                SourceReader.Dispose();
            }
            if (TargetWriter != null)
            {
                TargetWriter.Flush();
                TargetWriter.Close();
                TargetWriter.Dispose();
            }

            if (SourceStream != null)
            {
                SourceStream.Close();
                SourceStream.Dispose();
            }
            if (TargetStream != null)
            {
                TargetStream.Close();
                TargetStream.Dispose();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Dispose - by default (IgnoreDispose = true) will do nothing,
 /// leaving the underlying stream undisposed
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (!IgnoreDispose)
     {
         SourceStream.Dispose();
         SourceStream = null;
     }
 }
Exemplo n.º 3
0
 public override Task <bool> StaunchFlow()
 {
     if (Socket.Connected)
     {
         Socket.Disconnect(true);
         SourceStream.Dispose();
         SourceStream = null;
     }
     return(base.StaunchFlow());
 }
        /// <summary>
        /// Cleans up the underlying stream.
        /// </summary>
        /// <param name="disposing"></param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                SourceStream.Dispose();
                SourceStream = null;
            }

            base.Dispose(disposing);
        }
Exemplo n.º 5
0
 public virtual void Dispose()
 {
     if (!disposed)
     {
         lazyVolumes.ForEach(v => v.Dispose());
         lazyEntries.GetLoaded().Cast <Entry>().ForEach(x => x.Close());
         if (SrcStream != null)
         {
             SrcStream.Dispose();
         }
         disposed = true;
     }
 }
Exemplo n.º 6
0
        public override void ExecuteResult(ControllerContext context)
        {
            var res = context.HttpContext.Response;

            res.Clear();
            res.Cache.SetCacheability(HttpCacheability.ServerAndPrivate);
            res.ContentType = ContentType;

            if (SourceStream is MemoryStream)
            {
                ((MemoryStream)SourceStream).WriteTo(res.OutputStream);
                SourceStream.Dispose();
            }
            else
            {
                res.TransmitFile(SourceFilename);
            }
        }
Exemplo n.º 7
0
 public void EndLoadingSkippedComponents()
 {
     SourceStream.Close();
     SourceStream.Dispose();
     SourceStream = null;
 }