how to write an event on variable value change?
how to write an event on variable value change? I have a class level variable declared and then it's value changed (it is changed from other class object) i need that it raise an event Is that possible and how it's done?
[229 byte] By [
Auris] at [2007-12-22]
I will give short description of my app Maybe it will be easyer to help me:
All app long tasks is executed on backGround worker control and when app is started it creates an object of class B wich monitors some fileactivity on certain directorys So basicly i have 3 threads main thread ,background worker thread and class B wich has two more references to timer controls.
When timer function spots some activity it collects data and passes it back to class B there it is analyzed and if needed added to may arraylist of collections with other data(arraylist has reference to class A or is passed from class A) The updated arraylist is passed back automaticly. Then i need to reload my listview control on class A (User interface and some functions) This task is writen on background worker control And if i exetute BW from event raised on class B it never raises the complete event because class B stil exists and timers are still active So i have may background thread busy and any further operations rezult in error because BW can do only one task at a time. So i thougt it would be good that i figure out a way how tu raise event from class A when the arraylist variable is updated.
Maybe it sounds little confusing or silly but i'm new on multithreading (first time using BW) and quite new to VB.NET so plz be patient and thank you for your time and advice