internal PSDataCollectionStream(Guid psInstanceId, PSDataCollection <T> storeToUse)
 {
     using (ObjectStreamBase._trace.TraceConstructor((object)this))
     {
         this._objects     = storeToUse != null ? storeToUse : throw ObjectStreamBase._trace.NewArgumentNullException(nameof(storeToUse));
         this.psInstanceId = psInstanceId;
         this.isOpen       = true;
         storeToUse.AddRef();
         storeToUse.DataAdded += new EventHandler <DataAddedEventArgs>(this.HandleDataAdded);
         storeToUse.Completed += new EventHandler(this.HandleClosed);
     }
 }
 internal PSDataCollectionStream(Guid psInstanceId, PSDataCollection <T> storeToUse)
 {
     this._syncObject = new object();
     if (storeToUse == null)
     {
         throw PSTraceSource.NewArgumentNullException("storeToUse");
     }
     this._objects     = storeToUse;
     this.psInstanceId = psInstanceId;
     this.isOpen       = true;
     storeToUse.AddRef();
     storeToUse.DataAdded += new EventHandler <DataAddedEventArgs>(this.HandleDataAdded);
     storeToUse.Completed += new EventHandler(this.HandleClosed);
 }