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; }
public CommandHelpForm() { InitializeComponent(); Dictionary <string, string> commandsDescriptions = ServerCommands.GetCommandsDescriptions(); Dictionary <string, string> commandsSyntaxExamples = ServerCommands.GetCommandsSyntaxExamples(); foreach (var item in commandsDescriptions) { ListViewItem listViewItem = new ListViewItem(item.Key); listViewItem.SubItems.Add(item.Value); listViewItem.SubItems.Add(commandsSyntaxExamples.FirstOrDefault(x => x.Key == item.Key).Value); lv_commands.Items.Add(listViewItem); } }
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); } }