private void Timer_tick(ThreadPoolTimer timer) { lock (thisLock) { //get the previous state BitArray temp = new BitArray(this.currentstate); read(); //check if previous state = current state if (!comparebitarray(temp, this.currentstate, PinQT)) { Dictionary <int, bool> addstate = new Dictionary <int, bool>(); for (int pinbit = 0; pinbit <= PinQT; pinbit++) { if (temp[pinbit] != this.currentstate[pinbit]) { pinchange statechange = new pinchange(); if (this.currentstate[pinbit] == true) { addstate.Add(pinbit, true); } else { addstate.Add(pinbit, false); } } } statechange.pinstate = addstate; OnChange(statechange); } } }
private void triggered(pinchange m) { foreach (KeyValuePair <int, bool> pin in m.pinstate) { Shift595N.putEnabled(pin.Key, pin.Value); } }
private void triggered(pinchange m) { }