public TkbController(TkbTrayIcon icon, TkbContextMenu menu, UiInvoke uiInvoke) { m_Icon = icon; m_Menu = menu; m_UiIvoke = uiInvoke; m_Client = new AntelopeClient(this); }
static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // todo: avoid race condition? using (var menu = new TkbContextMenu()) using (var icon = new TkbTrayIcon(menu)) using (var uiInvoke = new UiInvoke()) using (var controller = new TkbController(icon, menu, uiInvoke)) using (new KeyboardHook(controller)) using (new AntelopeBeaconListener(controller)) { uiInvoke.CreateControl(); menu.AdviseEvents(controller); Application.Run(); } } catch (Exception ex) { Console.WriteLine("Exception in Main(): {0}", ex); } }