예제 #1
0
        void AddOnlineVideo()
        {
            BotPage      botPage = GetBotPage();
            ControlVideo cv      = new ControlVideo(botPage.bot);

            AddControlPage(botPage, cv, "Видео");
        }
        public void Init(Server.IdUid currBot, int style)
        {
            BotPage ret = botPages.Find(b => b.bot == currBot);

            if (ret == null)
            {
                ret     = new BotPage();
                ret.bot = currBot;
                if (GetTabs().TabPages.Count == 1 && botPages.Count == 0) //вставляем 1-ю вкладку (одна пустая вкладка уже есть, для красоты)
                {
                    ret.page = GetTabs().TabPages[0];
                }
                else
                {
                    ret.page = new TabPage();
                    GetTabs().TabPages.Add(ret.page);
                }
                botPages.Add(ret);
                ret.page.Text = currBot.uid;
            }
            if (style == 0)
            {
                ControlVideo cv = new ControlVideo(ret.bot);
                if (ret.controls == null)
                {
                    ret.controls      = new ControlBotPages();
                    ret.controls.Dock = DockStyle.Fill;
                    ret.page.Controls.Add(ret.controls);
                    ret.controls.Start();
                }
                ret.controls.AddPage(cv, "Видео");
            }
            if (style == 1)
            {
                RemoteControl rc = new RemoteControl();
                rc.host = currBot.server.IP;                // "127.0.0.1";//currBot.ip;
                string [] ports;
                ports   = currBot.ports.Split(' ');
                rc.port = Convert.ToInt32(ports[0]);
                if (ret.controls == null)
                {
                    ret.controls      = new ControlBotPages();
                    ret.controls.Dock = DockStyle.Fill;
                    ret.page.Controls.Add(ret.controls);
                    ret.controls.Start();
                }
                ret.controls.AddPage(rc, "VNC");
            }
            GetTabs().SelectedTab = ret.page;
        }
예제 #3
0
 public VideoStream(ControlVideo ctrl)
 {
     this.ctrl = ctrl;
 }