Exemplo n.º 1
0
 void addMultipleToolStripMenuItem_ButtonClicked(object sender, AddMultipleUpdateArgs Panels)
 {
     for (int i = 0; i < Panels.Quantity; i++)
     {
         UrlPanel urlPanel = new UrlPanel
         {
             Url = Panels.Template,
             InputLock = false,
             Label = Panels.Label,
             panel = New_Panel(Panels.Template, false, Panels.Label)
         };
         Panel_List.Add(urlPanel);
     }
 }
Exemplo n.º 2
0
 void addToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UrlPanel urlPanel = new UrlPanel();
     urlPanel.panel = New_Panel(null, false, null);
     Panel_List.Add(urlPanel);
 }
Exemplo n.º 3
0
        void OpenNewScreen(int screen)
        {
            foreach (UrlPanel urlPanel in Panel_List)
            {
                urlPanel.Url = urlPanel.panel.Controls.OfType<TextBox>().ToList()[0].Text;
                urlPanel.Label = urlPanel.panel.Controls.OfType<TextBox>().ToList()[1].Text;
            }

            form3 = new Form();
            form3.Controls.Clear();
            Screen screenToUse = Screen.AllScreens[screen];

            form3.FormBorderStyle = FormBorderStyle.None;
            form3.Icon = Properties.Resources.DispatchViewer;
            form3.WindowState = FormWindowState.Maximized;
            form3.BackColor = Color.Black;
            form3.FormClosed += new FormClosedEventHandler(Form_Closing);

            form3.StartPosition = FormStartPosition.Manual;
            form3.Location = screenToUse.Bounds.Location;

            ContextMenuStrip menu = new ContextMenuStrip();
            menu.Items.Add("Exit");
            menu.ItemClicked += Menu_ItemClicked;
            form3.ContextMenuStrip = menu;

            int count = 0;
            int ScreenH = screenToUse.Bounds.Height; int ScreenW = screenToUse.Bounds.Width;
            int total = Panel_List.Count;

            int rows = 0;
            int cols = 0;

            if (AttemptedCols != 0 & AttemptedRows != 0)
            {
                cols = AttemptedCols;
                rows = AttemptedRows;
            }
            else
            {
                if (Panel_List.Count == 1)
                {
                    rows = 1;
                    cols = 1;
                }
                else
                {
                    if (ScreenH < ScreenW)
                    {
                        rows = 2;
                        cols = Convert.ToInt32(Math.Ceiling((decimal)total / 2));
                    }
                    else
                    {
                        cols = 2;
                        rows = Convert.ToInt32(Math.Ceiling((decimal)total / 2));
                    }
                }
            }

            try
            {
                for (int i = 0; i < rows; i++)
                {
                    for (int j = 0; j < cols; j++)
                    {
                        UrlPanel urlPanel = Panel_List[count];

                        VlcControl vlcControl = new VlcControl();
                        vlcControl.BeginInit();
                        vlcControl.VlcLibDirectory = vlcLibDirectory;
                        vlcControl.VlcMediaplayerOptions = new[] { "-vvv" };
                        vlcControl.EndInit();
                        vlcControl.SetMedia(urlPanel.Url);

                        vlcControl.Play();
                        vlcControl.Enabled = true;

                        vlcControl.Dock = DockStyle.None;
                        vlcControl.Size = new Size(ScreenW / cols, (ScreenH / rows) - 30);
                        vlcControl.Location = new Point((ScreenW / cols) * j, (ScreenH / rows) * i + 30);

                        #region Label
                        Label AddressLabel = new Label
                        {
                            Text = (urlPanel.Label != String.Empty) ? urlPanel.Label : urlPanel.Url,
                            Height = 30,
                            Width = (ScreenW / cols) / 3,

                            Font = new Font(Font.FontFamily, 16),
                            ForeColor = Color.White,
                            Cursor = Cursors.Hand,
                            AutoEllipsis = true,

                            Tag = vlcControl,
                            Location = new Point((ScreenW / cols) * j, (ScreenH / rows) * i)
                        };
                        AddressLabel.Click += new EventHandler(Label_Clicked);

                        #endregion

                        Button button1 = new Button
                        {
                            Text = "Rec.",
                            BackColor = Color.White,
                            Height = 30,
                            Width = 65,
                            Font = new Font(Font.FontFamily, 10),
                            Location = new Point(AddressLabel.Right + 15, AddressLabel.Location.Y),
                            Tag = vlcControl
                        };
                        button1.Click += button1_Click;

                        form3.Controls.Add(button1);
                        form3.Controls.Add(AddressLabel);
                        form3.Controls.Add(vlcControl);
                        VlcControlList.Add(vlcControl);

                        count++;
                    }
                }
            }
            catch (Exception)
            {
            }

            form3.Show();
            formOpen = true;
        }