Example #1
0
        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;
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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");
            }
        }
Example #4
0
        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);
            }
        }