protected override void ProcessRawEvent(Object sender, RawEventArgs e) { Match m = reCALL.Match(e.Line); if (m.Success) { int callID = int.Parse(m.Groups[1].Value); CallStatus callStatus = (CallStatus) int.Parse(m.Groups[2].Value); CallType callType = (CallType) int.Parse(m.Groups[3].Value); Call call = GetCall(callID); call.Status = callStatus; call.Type = callType; String number = m.Groups[6].Value; // We should add more properties here, like exit code etc. if (number.Length > 0) { // If number type is 145, we have to prepend a + to the number if (m.Groups[7].Value.Equals("145")) { call.Number = "+" + number; } else { call.Number = number; } } if (OnPhoneCall != null) { OnPhoneCall(this, new CallEventArgs(call)); } } }
protected void ProcessRawLine(Object sender, RawEventArgs e) { if (e.Line.Equals("*SEAAI: " + this.id)) { Console.WriteLine("Menu item »" + name + "« has been triggered via delegate"); if (OnSelect != null) this.OnSelect(this, new AccessoryMenuEventArgs(this)); } }
protected override void ProcessRawEvent(Object sender, RawEventArgs e) { Match m = reKEY.Match(e.Line); if (m.Success) { String key = m.Groups[1].Value; KeyCode code = KeyCode.Lookup(key); // press or release? KeyAction action = (int.Parse(m.Groups[2].Value) == 1) ? KeyAction.Pressed : KeyAction.Released; if (OnKeyPress != null) { OnKeyPress(this, new KeyEventArgs(code, action)); } } }
public void incomingLine(Object sender, RawEventArgs e) { Console.WriteLine("«Event» " + e.Line); }
///<summary>Instantiate a new propagator to carry the event to a handler.</summary> ///<param name="handler">The receiver the event should be delivered to</param> ///<param name="e">The arguments to the occuring event</param> public RawEventPropagator(RawEventHandler handler, RawEventArgs e) { this.handler = handler; this.e = e; ThreadStart threadDelegate = new ThreadStart(this.Run); Thread newThread = new Thread(threadDelegate); newThread.Start(); }
protected abstract void ProcessRawEvent(Object sender, RawEventArgs e);