コード例 #1
0
        //end of initialisation



        public Main()
        {
            back = new bridge();
            back.Main();

            InitializeComponent();

            home_panel      = new Home(back);
            links_panel     = new Links(back);
            downloads_panel = new Downloads(back);
            about_panel     = new About();
        }
コード例 #2
0
        public Home(bridge back_ref)
        {
            back = back_ref;


            InitializeComponent();

            search_res        = new Panel();
            search_res.Dock   = DockStyle.Bottom;
            search_res.Height = 405;
            search_res.BringToFront();
            search_res.BackgroundImage       = n_tube.Properties.Resources.Asset_14;
            search_res.BackgroundImageLayout = ImageLayout.Zoom;
            search_res.AutoScroll            = true;
            search_res.Show();
            this.Controls.Add(search_res);

            searchin_txt.Hide();

            padd        = new Panel();
            padd.Dock   = DockStyle.Bottom;
            padd.Height = 20;
            padd.BringToFront();
            padd.Show();
            search_res.Controls.Add(padd);

            settings_panel.Hide();
            menu_open = false;

            vids = new List <Video>();

            List <Obj> formats = new List <Obj>();

            formats.Add(new Obj {
                flag = "m4h", name = "mp4(720p)"
            });
            formats.Add(new Obj {
                flag = "m4l", name = "mp4(320p)"
            });
            formats.Add(new Obj {
                flag = "m3", name = "mp3"
            });
            format_box.DataSource    = formats;
            format_box.DisplayMember = "name";
            format_box.ValueMember   = "flag";

            sv_path.Text = back.getPath();


            populate();
        }
コード例 #3
0
        public Links(bridge back_ref)
        {
            back = back_ref;



            InitializeComponent();


            List <Obj> formats = new List <Obj>();

            formats.Add(new Obj {
                flag = "m4h", name = "mp4(720p)"
            });
            formats.Add(new Obj {
                flag = "m4l", name = "mp4(320p)"
            });
            formats.Add(new Obj {
                flag = "m3", name = "mp3"
            });
            format_box.DataSource    = formats;
            format_box.DisplayMember = "name";
            format_box.ValueMember   = "flag";


            List <Obj> types = new List <Obj>();

            types.Add(new Obj {
                flag = "--url", name = "url"
            });
            types.Add(new Obj {
                flag = "--file", name = "file"
            });
            types.Add(new Obj {
                flag = "--list", name = "playlist"
            });
            type_box.DataSource    = types;
            type_box.DisplayMember = "name";
            type_box.ValueMember   = "flag";


            back.setDQlty("m4h");
            back.setDFmt("--url");

            web_preview.Margin = new Padding(0);


            sv_p_lbl.Text = back.getPath();
            //int x = int(100.2);
        }
コード例 #4
0
        public Downloads(bridge back_ref)
        {
            InitializeComponent();

            back = back_ref;

            string[] data = File.ReadAllText("./nBack/download_history.txt").Split('|');



            history = new List <Downloaded>();

            foreach (var be in data)
            {
                history.Add(new Downloaded(history_pannel, be));
            }
        }
コード例 #5
0
        public Video(Panel Cont, string data, bridge back_ref)
        {
            back = back_ref;


            props = data.Split('^');



            r1 = new Panel();

            img_scr = new WebBrowser();
            dwn_btn = new Button();
            name    = new Label();
            r2      = new Panel();
            lvl     = new ProgressBar();



            lvl.Height = 10;
            lvl.BringToFront();
            lvl.Value = 0;
            lvl.Dock  = DockStyle.Bottom;
            lvl.Hide();

            r1.BackColor = Color.FromArgb(50, 50, 50);


            r1.Left            = 20 + (x * 20) + (x++ *280);
            r1.Top             = 20 + (y * 20) + (y * 200);
            r1.Width           = 280;
            r1.Height          = 200;
            r2.Height          = 50;
            dwn_btn.Width      = 45;
            dwn_btn.Image      = n_tube.Properties.Resources.download_32px;
            dwn_btn.ImageAlign = ContentAlignment.MiddleCenter;
            dwn_btn.FlatStyle  = FlatStyle.Flat;
            dwn_btn.BackColor  = Color.Black;


            name.Text      = props[1];
            name.ForeColor = Color.White;
            name.Width     = 230;
            name.Padding   = new Padding(5);
            name.Dock      = DockStyle.Left;


            img_scr.Height            = 150;
            img_scr.ScrollBarsEnabled = false;
            img_scr.Dock = DockStyle.Top;
            r2.Dock      = DockStyle.Bottom;
            dwn_btn.Dock = DockStyle.Right;

            //img_scr.Url = new Uri(props[2]);

            img_scr.DocumentText = "<style> " +
                                   "body { " +
                                   "margin: 0; " +
                                   "padding: 0; " +
                                   "} " +
                                   "img {" +
                                   "width: 20px" +
                                   "height: 10px" +
                                   "}" +
                                   "</style> " +
                                   $"<img src='{props[2]}' />";

            Cont.Controls.Add(r1);
            r1.BringToFront();
            r1.Controls.Add(img_scr);
            r1.Controls.Add(r2);
            r2.Controls.Add(dwn_btn);
            r2.Controls.Add(name);
            r2.Controls.Add(lvl);

            if (x == 2)
            {
                x = 0;
                y++;
            }

            dwn_btn.Click += new EventHandler(dwn_btn_Click);
        }