/// <summary>
 /// Update the stream state and adds adds the filtered objects
 /// </summary>
 /// <param name="state"></param>
 public override void PersistAndUpdateStreamInFile(StreamState state)
 {
   var index = DocumentStreams.FindIndex(b => b.Stream.id == state.Stream.id);
   if (index != -1)
   {
     DocumentStreams[index] = state;
     WriteStateToFile();
   }
 }
 /// <summary>
 /// Adds a new stream to the file.
 /// </summary>
 /// <param name="state">StreamState passed by the UI</param>
 public override void AddNewStream(StreamState state)
 {
   var index = DocumentStreams.FindIndex(b => b.Stream.id == state.Stream.id);
   if (index == -1)
   {
     DocumentStreams.Add(state);
     WriteStateToFile();
   }
 }