Пример #1
0
 // other constructors can be added later, as we need them, for now we only use the following 2
 internal TrackingMemoryStream(ITrackingMemoryStreamFactory memoryStreamFactory) : base()
 {
     // although we could have implemented this constructor in terms of the other constructor; we shouldn't.
     // It seems safer to always call the equivalent base class constructor, as we might be ignorant about
     // some minor differences between various MemoryStream constructors
     Debug.Assert(memoryStreamFactory != null);
     _memoryStreamFactory = memoryStreamFactory;
     ReportIfNeccessary();
 }
 // other constructors can be added later, as we need them, for now we only use the following 2  
 internal TrackingMemoryStream(ITrackingMemoryStreamFactory memoryStreamFactory): base()
 {
     // although we could have implemented this constructor in terms of the other constructor; we shouldn't. 
     // It seems safer to always call the equivalent base class constructor, as we might be ignorant about 
     // some minor differences between various MemoryStream constructors
     Debug.Assert(memoryStreamFactory != null);            
     _memoryStreamFactory = memoryStreamFactory;
     ReportIfNeccessary();
 }
Пример #3
0
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (disposing && (this._memoryStreamFactory != null))
         {
             this.SetLength(0L);
             this.Capacity = 0;
             this.ReportIfNeccessary();
             this._memoryStreamFactory = null;
         }
     }
     finally
     {
         base.Dispose(disposing);
     }
 }
Пример #4
0
 internal TrackingMemoryStream(ITrackingMemoryStreamFactory memoryStreamFactory, int capacity)
     : base(capacity)
 {
     this._memoryStreamFactory = memoryStreamFactory;
     this.ReportIfNeccessary();
 }
Пример #5
0
 // Methods
 internal TrackingMemoryStream(ITrackingMemoryStreamFactory memoryStreamFactory)
 {
     this._memoryStreamFactory = memoryStreamFactory;
     this.ReportIfNeccessary();
 }
Пример #6
0
 internal TrackingMemoryStream(ITrackingMemoryStreamFactory memoryStreamFactory, Int32 capacity) : base(capacity)
 {
     Debug.Assert(memoryStreamFactory != null);
     _memoryStreamFactory = memoryStreamFactory;
     ReportIfNeccessary();
 }
 internal TrackingMemoryStream (ITrackingMemoryStreamFactory memoryStreamFactory, Int32 capacity) : base(capacity)
 {
     Debug.Assert(memoryStreamFactory != null);
     _memoryStreamFactory = memoryStreamFactory;
     ReportIfNeccessary();
 }