/// <summary> /// Recreate context menu and reconnect to bridge. /// </summary> public void Reload() { var menuItems = new List<MenuItem>(); // Add light control menu items for (int group = 0; group <= 4; group++) { AddLightControlMenuItems(ref menuItems, group); } // Add miscellaneous items after a separator menuItems.Add(new MenuItem("-")); menuItems.Add(new MenuItem("Configuration", ShowConfig)); menuItems.Add(new MenuItem("Exit", Exit)); _notifyIcon.ContextMenu = new ContextMenu(menuItems.ToArray()); // Connect to bridge _bridge = new LightBridge((string) Settings.Default["BridgeAddress"]); }
/// <summary> /// Recreate context menu and reconnect to bridge. /// </summary> public void Reload() { var menuItems = new List <MenuItem>(); // Add light control menu items for (int group = 0; group <= 4; group++) { AddLightControlMenuItems(ref menuItems, group); } // Add miscellaneous items after a separator menuItems.Add(new MenuItem("-")); menuItems.Add(new MenuItem("Configuration", ShowConfig)); menuItems.Add(new MenuItem("Exit", Exit)); _notifyIcon.ContextMenu = new ContextMenu(menuItems.ToArray()); // Connect to bridge _bridge = new LightBridge((string)Settings.Default["BridgeAddress"]); }
/// <summary> /// Event handler for automatic IP find button. /// </summary> private void buttonIPFind_Click(object sender, EventArgs e) { textIP.Text = LightBridge.GetBroadcastAddress().ToString(); }