private void tBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) { if (e.Button == bExit) { Close(); return; } if (e.Button == bRefresh) { TheBox.BoxServer.BoxMessage msg = Pandora.BoxConnection.SendToServer(new TheBox.BoxServer.ClientListRequest()); TheBox.BoxServer.ClientListMessage list = msg as ClientListMessage; if (msg != null) { m_Clients.Clear(); m_Clients.AddRange(list.Clients); } Refresh(); return; } foreach (ToolBarButton b in tBar.Buttons) { b.Pushed = false; } e.Button.Pushed = true; Map = int.Parse(e.Button.Tag as string); }
private void VisualClientList_Load(object sender, System.EventArgs e) { ToolBarButton[] buttons = new ToolBarButton[] { map0, map1, map2, map3 }; for (int i = 0; i < 4; i++) { buttons[i].Visible = Pandora.Profile.Travel.EnabledMaps[i]; if (Pandora.Profile.Travel.EnabledMaps[i]) { buttons[i].Text = Pandora.Profile.Travel.MapNames[i]; } } TheBox.BoxServer.BoxMessage msg = Pandora.BoxConnection.SendToServer(new TheBox.BoxServer.ClientListRequest()); TheBox.BoxServer.ClientListMessage list = msg as ClientListMessage; if (list != null) { m_Clients = list.Clients; } else { // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert m_Clients = new List <ClientEntry>(); // Issue 10 - End } for (int i = 0; i < 4; i++) { if (Pandora.Profile.Travel.EnabledMaps[i]) { tBar.Buttons[i].Pushed = true; Map = i; return; } } Close(); }