hey,

I've been reading awhile about events.

I can actually work with them and create custom events for booleans, integer, arrays, etc, but only for those I've created.

I cant seem to figure out how to add a listener upon a variable that I did not declare.

For exaple, via the CoreAudioAPI library I can readout the currrent speakerconfig. ie. 8. (= 7.1 surround).
Which is an integervalue (device.AudioMeterInformation.PeakValues.Count)

How Can I automatically fire an event when that value changes?
I mean, without using a small thread, timer, etc...

Is this even possible?

thx in advance,
Nick

>How Can I automatically fire an event when that value changes? I mean, without using a small thread, timer, etc...


Yes! you can. Compare previous value and current value and raise an event if they are unequal.

Hey,

Thats what i did for now.

But I have used a time to periodically compare the two values and then fire an event.

So it is not possible to get this completely managed by the .NET system? So that I don't have to use a timer to periodically compare the values?

thx,
Nick

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.