|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Possible to monitor changes in array (with event)?Hi folks,
I hope that anyone can give me a tip about this problem. I need to monitor the content of an array (boolean variables). The best thing would be if I was able to create an event that's being triggered when one of the variables changes (ideally giving the index of that changed variable). I thought about using a timer, but the problem is that it's not very reliable (a variable might have changed right after it was checked), so what can I do? Thanks in advance for your help. Best Regards, HKSHK HKSHK wrote:
> I need to monitor the content of an array (boolean variables). The best Wrap your array in a class derived from CollectionBase and override its > thing would be if I was able to create an event that's being triggered > when one of the variables changes (ideally giving the index of that > changed variable). OnSet routine to trap each change. Class BoolArray Public Event ItemChanged( ByVal index as Integer, ... Protected Overrides OnSet( _ ByVal Index as Integer _ , ByVal oldValue as Object _ , ByVal newValue as Object _ ) If Not [Object].Equals( oldValue, newValue ) Then RaiseEvent ItemSet( index, ... End If End Sub End Class HTH, Phill W.
Porting VB6 to .Net - DDE replacement?
Binding currencyManager and dataRelation - datagridview - possible Problem loading XML Application.Exit Need help with Conversion from C# to VB.net text align datagrid current record Debug.WriteLine Doesn't Produce Output Looping through Dataset How do I add a MSI file to Prerequisite list? |
|||||||||||||||||||||||