static void Main(string[] args) { spokes = Spokes.Instance; spokes.PutOn += new Spokes.PutOnEventHandler(spokes_PutOn); spokes.TakenOff += new Spokes.TakenOffEventHandler(spokes_TakenOff); spokes.Near += new Spokes.NearEventHandler(spokes_Near); spokes.Far += new Spokes.FarEventHandler(spokes_Far); spokes.InRange += new Spokes.InRangeEventHandler(spokes_InRange); spokes.OutOfRange += new Spokes.OutOfRangeEventHandler(spokes_OutOfRange); spokes.Docked += new Spokes.DockedEventHandler(spokes_Docked); spokes.UnDocked += new Spokes.DockedEventHandler(spokes_UnDocked); spokes.MobileCallerId += new Spokes.MobileCallerIdEventHandler(spokes_MobileCallerId); spokes.OnMobileCall += new Spokes.OnMobileCallEventHandler(spokes_OnMobileCall); spokes.NotOnMobileCall += new Spokes.NotOnMobileCallEventHandler(spokes_NotOnMobileCall); spokes.SerialNumber += new Spokes.SerialNumberEventHandler(spokes_SerialNumber); spokes.CallAnswered += new Spokes.CallAnsweredEventHandler(spokes_CallAnswered); spokes.CallEnded += new Spokes.CallEndedEventHandler(spokes_CallEnded); spokes.CallSwitched += new Spokes.CallSwitchedEventHandler(spokes_CallSwitched); spokes.OnCall += new Spokes.OnCallEventHandler(spokes_OnCall); spokes.NotOnCall += new Spokes.NotOnCallEventHandler(spokes_NotOnCall); spokes.MuteChanged += new Spokes.MuteChangedEventHandler(spokes_MuteChanged); spokes.LineActiveChanged += new Spokes.LineActiveChangedEventHandler(spokes_LineActiveChanged); spokes.Attached += new Spokes.AttachedEventHandler(spokes_Attached); spokes.Detached += new Spokes.DetachedEventHandler(spokes_Detached); spokes.CapabilitiesChanged += new Spokes.CapabilitiesChangedEventHandler(spokes_CapabilitiesChanged); spokes.MultiLineStateChanged += new Spokes.MultiLineStateChangedEventHandler(spokes_MultiLineStateChanged); // NOTE: we will not call Connect on spokes until client app has connected // otherwise client will miss initial state events! socket = new SpokesSocketInterface(spokes); socket.StartSocket(); // TODO make socket threaded so you are not stuck in a loop in above call... Console.WriteLine("Enter to quit"); Console.ReadLine(); socket.StopSocket(); }
static void Main(string[] args) { spokes = Spokes.Instance; spokes.PutOn += new Spokes.PutOnEventHandler(spokes_PutOn); spokes.TakenOff += new Spokes.TakenOffEventHandler(spokes_TakenOff); spokes.Near += new Spokes.NearEventHandler(spokes_Near); spokes.Far += new Spokes.FarEventHandler(spokes_Far); spokes.InRange += new Spokes.InRangeEventHandler(spokes_InRange); spokes.OutOfRange += new Spokes.OutOfRangeEventHandler(spokes_OutOfRange); spokes.Docked += new Spokes.DockedEventHandler(spokes_Docked); spokes.UnDocked += new Spokes.DockedEventHandler(spokes_UnDocked); spokes.MobileCallerId += new Spokes.MobileCallerIdEventHandler(spokes_MobileCallerId); spokes.OnMobileCall += new Spokes.OnMobileCallEventHandler(spokes_OnMobileCall); spokes.NotOnMobileCall += new Spokes.NotOnMobileCallEventHandler(spokes_NotOnMobileCall); spokes.SerialNumber += new Spokes.SerialNumberEventHandler(spokes_SerialNumber); spokes.CallAnswered += new Spokes.CallAnsweredEventHandler(spokes_CallAnswered); spokes.CallEnded += new Spokes.CallEndedEventHandler(spokes_CallEnded); spokes.CallSwitched += new Spokes.CallSwitchedEventHandler(spokes_CallSwitched); spokes.OnCall += new Spokes.OnCallEventHandler(spokes_OnCall); spokes.NotOnCall += new Spokes.NotOnCallEventHandler(spokes_NotOnCall); spokes.MuteChanged += new Spokes.MuteChangedEventHandler(spokes_MuteChanged); spokes.LineActiveChanged += new Spokes.LineActiveChangedEventHandler(spokes_LineActiveChanged); spokes.Attached += new Spokes.AttachedEventHandler(spokes_Attached); spokes.Detached += new Spokes.DetachedEventHandler(spokes_Detached); spokes.CapabilitiesChanged += new Spokes.CapabilitiesChangedEventHandler(spokes_CapabilitiesChanged); spokes.MultiLineStateChanged += new Spokes.MultiLineStateChangedEventHandler(spokes_MultiLineStateChanged); // NOTE: we will not call Connect on spokes until client app has connected // otherwise client will miss initial state events! socket = new SpokesSocketInterface(spokes); socket.StartSocket(); // TODO make socket threaded so you are not stuck in a loop in above call... Console.WriteLine("Enter to quit"); Console.ReadLine(); socket.StopSocket(); }