private void BelowClientListBox_SelectionChangeCommitted(object sender, EventArgs e) { ConnectedClientInfo clientA = BelowClientListBox.SelectedItem as ConnectedClientInfo; if (clientA == ConnectedClientInfo.None) { server.SetClientEdge(null, BoundEdge.Bottom, selectedClient); } else { server.SetClientEdge(clientA, BoundEdge.Bottom, selectedClient); } UpdateClientList(); RedrawClientSettings(); }
//SET X sideof Y private static void Cmd_Set(string arg1, string arg2, string arg3) { if (!server.Running) { Console.WriteLine("Server not running"); return; } ClientInfo[] clients = server.GetAllClients(); ClientInfo clientA = null; ClientInfo clientB = null; foreach (var client in clients) { if (arg1 != "none") { if (client.Name.ToLower().Contains(arg1)) { clientA = client; } } if (client.Name.ToLower().Contains(arg3)) { clientB = client; } } if ((clientA == null && arg1 != "none") || clientB == null) { Console.WriteLine("Invalid client"); ListClients(); return; } if (clientA == clientB) { Console.WriteLine("Cannot set X sideof X"); return; } if (Enum.TryParse(typeof(Edge), arg2, true, out object side)) { Edge edge = (Edge)side; if (arg1 == "none") { server.RemoveClientEdge(clientB, edge); } else { server.SetClientEdge(clientA, edge, clientB); } } else { Console.WriteLine("Invalid side of client"); Console.WriteLine("Sides: left, right, top, bottom, none"); return; } }