I have a scenario that i need to implement. the scenario is below.
I have a class handler and a class Healthmonitor. every 10 seconds i have to send a msg to HealthMonitor to update a variable. in one point if it didnt send a msg in a multiple of 10 seconds HealthMonitor DO SOMETHING ELSE
How do i implement this. can someone give an idea to achieve this
You start a timer routine, that will fire the class event every 10 seconds, your code can interrupt this if needed, by turning the timer off then on. Your class may need a method to allow this, perhaps PerformEvent(). Then this routine can call it with something like this, MyClass.PerformEvent();
Your handler, will then keep track of the time of the last event and do what needs to be done based on comparing the time now.
In this article,How to: Raise and Consume Events, is a full sample that shows you everything you need to know about handling events. Basically, in your sender is an event method to call the handler. You create code to fire the event, then in the handler you write code depending on the information sent from the event.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...