public CommandForm(string id) { InitializeComponent(); List <string> commands = ServerCommands.GetCommandsList(); foreach (var cmd in commands) { combo_command.Items.Add(cmd); } this.Text += id; label_cmd.Text += id; }
private void button_ok_Click(object sender, EventArgs e) { List <string> cmds = ServerCommands.GetCommandsList(); bool isCorrect = cmds.Any(cmd => combo_command.Text.Contains((cmd))); if (isCorrect) { Command = combo_command.Text; this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Niepoprawna komenda"); } }
public MainForm() { InitializeComponent(); this.statusLabel_status.Text = "Bezczynny"; ImageList imgList = new ImageList(); imgList.Images.Add("connected", Resources.user_available); imgList.Images.Add("disconnected", Resources.user_invisible); lv_clients.SmallImageList = imgList; List <string> commands = ServerCommands.GetCommandsList(); foreach (string cmd in commands) { combo_command.Items.Add(cmd); } }