Listening to stream changes

  • Thread starter Thread starter Keith Patrick
  • Start date Start date
K

Keith Patrick

I am ultimately trying to do a real-time bind of sorts between a
MemoryStream to a TextBox such that as data is written to my stream, the
textbox remains up-to-date. There is some behinds-the-scenes data mgmt I
want to do, so I will ultimately have some intermediate class, but the
trouble I am hitting is how to determine when data is written to the stream.
Streams have no events, so I was wondering if there is some
generally-accepted means of doing this.
 
Nm...found a solution I like better: subclass MemoryStream into
TextBoxStream and just override Flush(). The additional processing of the
box (mainly overflow logic) will go in the TextChanged event of the TextBox
itself.
 
Back
Top