Example #1
0
        public static void HandleInput(string input, ClientBar bar)
        {
            string[] splitted = input.Split('|');

            if (splitted.Length < 1)
            {
                return;
            }

            switch (splitted[0])
            {
            case "info":
                HandleInformation(splitted, bar);
                break;

            case "error":
                ShowResult($"Error type: {splitted[1]}\r\n{splitted[2]}");
                break;

            case "cmd":
                MainForm.cmd.AddText(splitted[1]);
                break;    /*
                           * case "fbrowser":
                           * string[] paths = splitted[2].Split('*');
                           *
                           * if (splitted[1] == "main")
                           * Form1.fBrowser.Add(paths, true);
                           * else
                           * Form1.fBrowser.Add(paths);
                           * break;*/
            }

            bar.session.stream.Flush();
        }
Example #2
0
        private void MonitorForm_Load(object sender, EventArgs e)
        {
            btnHome.Image   = btnImages.Images[0];
            _backPanel.Dock = DockStyle.Fill;
            BodyContainer.Panel2.Controls.Add(_backPanel);

            TaskManager.LoadTask();
            //ContentPanel
            ContentTable.ColumnStyles.Clear();
            ContentTable.RowStyles.Clear();
            //ContentPanel.c
            ContentTable.ColumnCount = 1;
            ContentTable.RowCount    = 2;
            ContentTable.Refresh();

            //ContentTable.RowStyles.
            //ContentTable.Width = splitContainer2.Panel2.Width;

            for (int i = 0; i < 1; i++)
            {
                ContentTable.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
                ClientBar client = new ClientBar();
                client.SetPanelEvent(_panelEvent);
                //web.Height = (int)ContentTable.RowStyles[i].Height;
                ContentTable.Controls.Add(client);
                _webList.Add(i, client);
                //ColumnStyles sty =  new ColumnStyle();
                //ColumnStyles
                //ontentTable.ColumnStyles.Add(
            }
        }
Example #3
0
        private static void HandleInformation(string[] args, ClientBar bar = null)
        {
            switch (args[1])
            {
            case "general":
                bar.SetProperties(RemoveIndex(RemoveIndex(args, 0), 0));
                break;

            default:
                ShowResult(args[2]);
                break;
            }
        }
Example #4
0
        public static void Send(string command, ClientBar bar = null)
        {
            //convert the command into bytes (also add a | to cut out the backslash-zero stuff)
            byte[] bytes = Encoding.ASCII.GetBytes(command + "|");

            //send it
            if (bar == null)
            {
                MainForm.currentSelectedBar.session.SendCommand(bytes);
            }
            else
            {
                bar.session.SendCommand(bytes);
            }
        }
Example #5
0
        public static void CreateNewClientBar(TcpClient client)
        {
            if (clientPanel.Controls.Count == 0)
            {
                newestBarOffset = 0;
            }

            //create a new bar and set the location
            ClientBar bar = new ClientBar(client);

            bar.Location = new Point(0, newestBarOffset);

            //add the client bar to the container
            clientPanel.Invoke(new Action(() => clientPanel.Controls.Add(bar)));

            //update the bar offset
            newestBarOffset += bar.Height;
        }