Exemplo n.º 1
0
        static async void Play(int index)
        {
            StorageFolder ss = await rsf.CreateFolderAsync(lm[index].vid, CreationCollisionOption.OpenIfExists);

            PageManageEx.CreateNewPage(PageTag.playerEx);
            PlayerEx.PlayEx(index, ss);
        }
Exemplo n.º 2
0
        void UpdateArea(ref Area ar)
        {
            List <ImageContext> lic = ar.context;
            int             len     = lic.Count;
            List <ItemModE> lim     = ar.items;
            int             c       = lim.Count;
            ItemModE        im;

            for (int i = 0; i < len; i++)
            {
                if (i >= c)
                {
                    im = Component.CreateItemMod();
                    im.button.Click += (o, e) => {
                        object ob = (o as Button).DataContext;
                        if (ob != null)
                        {
                            VideoPage.SetAdress(o as string);
                            PageManageEx.CreateNewPage(PageTag.videopage);
                        }
                    };
                    ar.can.Children.Add(im.can);
                    lim.Add(im);
                }
                im = lim[i];
                ImageContext ic = lic[i];
                if (ic.src == null)
                {
                    break;
                }
                (im.img.Source as BitmapImage).UriSource = new Uri(ic.src);
                im.button.DataContext = ic.href;
                if (ic.title == null)
                {
                    im.title.Text = "";
                }
                else
                {
                    im.title.Text = ic.title;
                }
                if (!ar.expand)
                {
                    im.can.Visibility = Visibility.Collapsed;
                }
            }
            for (int i = c - 1; i >= len; i--)
            {
                im = lim[i];
                lim.RemoveAt(i);
                //ReCycleItemMod(im.index);
            }
        }
 static void TitleClick(UIElement u)
 {
     if (ic.vid == null)
     {
         return;
     }
     if (ic.vid == "")
     {
         return;
     }
     Player.Setvid(ic.vid);
     PageManageEx.CreateNewPage(PageTag.player);
 }
Exemplo n.º 4
0
 public static void Back()
 {
     if (PageManageEx.Back())
     {
         return;
     }
     else
     {
         Setting.SaveDispose();
         DownloadPage.SaveMission(() => {
             Application.Current.Exit();
         });
     }
 }
Exemplo n.º 5
0
        public static void PlayControl(string vid)
        {
            int index = vp.operation;

            switch (index)
            {
            case 1:
                DownLoad.AddVid(vid);
                Main.Notify("已添加至缓存列表", Component.nav_brush, Component.font_brush, 300);
                break;

            default:
                Player.Setvid(vid);
                PageManageEx.CreateNewPage(PageTag.player);
                break;
            }
        }
Exemplo n.º 6
0
        static void SizeChange(object sender, WindowSizeChangedEventArgs e)
        {
            screenX     = e.Size.Width;
            screenY     = e.Size.Height;
            canA.Width  = screenX;
            canA.Height = screenY;
#if phone
            if (screenX > screenY)
            {
                screenX -= 45;
            }
            else
            {
                screenY -= 25;
            }
#endif
            PageManageEx.ReSize(new Thickness(0, 0, screenX, screenY));
        }
Exemplo n.º 7
0
        public static void Create(Canvas p, Thickness m)
        {
            if (tb != null)
            {
                ReSize(m);
                return;
            }
            double w = m.Right - m.Left;

            tb          = new TextBox();
            tb.KeyDown += s_keydown;
            tb.Width    = w - 30;
            p.Children.Add(tb);

            ok        = new SymbolIcon();
            ok.Symbol = Symbol.Find;
            Thickness tk = new Thickness();

            tk.Left             = w - 30;
            tk.Right            = w;
            ok.Margin           = tk;
            ok.PointerReleased += (s, e) => { Find(); };
            p.Children.Add(ok);


            m.Top    += 40;
            m.Right  -= 4;
            m.Bottom -= 10;
            sv        = new Scroll_S();
            sv.SetParent(p);
            sv.ReSize(m);
            sv.Getmore   = () => { loading = true; index += 15; part++; Find(); };
            sv.itemclick = (o) => {
                VideoPage.SetAdress(o as string);
                PageManageEx.CreateNewPage(PageTag.videopage);
            };
#if desktop
            sv.ShowBorder();
#endif
        }
Exemplo n.º 8
0
        public static void Create(Canvas p, Thickness m)//parent,margin
        {
            margin = m;
            if (svb != null)
            {
                nb.can.Visibility = Visibility.Visible;
                nb.show_filter    = false;
                SettingChanged();
                ReSize(m);
                return;
            }
            load   = false;
            create = false;
            SetNav(0);
            parent        = p;
            svb           = new ScrollViewB();
            svb.itemclick = (o) =>
            {
                if (o != null)
                {
                    VideoPage.SetAdress(o as string);
                    PageManageEx.CreateNewPage(PageTag.videopage);
                }
            };
            lid = svb.data;
            svb.SetParent(p);
            svb.ReSize(m);
#if desktop
            svb.ShowBorder();
#endif
            buff_fid = new FilterItemData[8];
            create   = true;
            if (load)
            {
                Analyze();
            }
            CreateNavBar();
            ReSize(m);
        }
Exemplo n.º 9
0
        //static Border bk_ground;
        public static void Initial(Canvas can)
        {
            main_canv = can;
            Window.Current.SizeChanged += SizeChange;
#if desktop
            Window.Current.CoreWindow.KeyDown         += Core_KeyDown;
            Window.Current.CoreWindow.PointerReleased += (o, e) => {
                if (e.CurrentPoint.Properties.PointerUpdateKind == PointerUpdateKind.XButton2Released)
                {
                    Back();
                }
            };
#endif
            Timer.Inital();
            screenX = Window.Current.Bounds.Width;
            screenY = Window.Current.Bounds.Height;
#if phone
            if (screenX > screenY)
            {
                screenX -= 45;
            }
            else
            {
                screenY -= 23;
            }
#endif
            canA            = new Canvas();
            canA.Width      = screenX;
            canA.Height     = screenY;
            canA.Background = bk_brush;
            main_canv.Children.Add(canA);
            Timer.Delegate(LoadPart0, 1);
            PageManageEx.Initial(canA);
            PageManageEx.CreateNewPage(PageTag.main);
            Setting.GetRootFolder(null);
        }
 //static VideoAddress va;
 static void PlayControl(string vid)
 {
     Player.Setvid(vid);
     PageManageEx.CreateNewPage(PageTag.player);
 }
Exemplo n.º 11
0
        public static void Create(Canvas p, Thickness m)
        {
            if (sv != null)
            {
                sv.Show();
                ReSize(m);
                return;
            }
            task1 = load1 = false;
            WebClass.TaskGet("http://m.v.qq.com/index.html", (o) => {
                data1 = o;
                if (task1)
                {
                    ParseData.AnalyzeData(o.ToCharArray(), ref sv.area);
                    sv.Refresh();
                }
                else
                {
                    load1 = true;
                }
            });
            margin = m;
            sv     = new Scroll_ex();
#if desktop
            sv.maxcolumn = 5;
#else
            sv.maxcolumn = 4;
            sv.Lock      = MainEx.LockPivot;
            sv.UnLock    = MainEx.UnLockPivot;
#endif
            sv.UsingCustomTitle = true;
            sv.ForceUpdateOnce  = true;
            sv.area             = new Area_m[nav_all.Length];
            sv.ItemClick        = (o) => {
                if (o != null)
                {
                    VideoPage.SetAdress(o as string);
                    PageManageEx.CreateNewPage(PageTag.videopage);
                }
            };
            sv.PageClick = (o) => {
                PageAddress t = (PageAddress)o;
                if (t != PageAddress.None)
                {
                    PartialNav.LoadPage(t);
                    PageManageEx.CreateNewPage(PageTag.partial);
                }
            };
            for (int i = 0; i < nav_all.Length; i++)
            {
                int c = nav_all[i].count;
                sv.area[i].page  = nav_all[i].page;
                sv.area[i].title = nav_all[i].title;
                sv.area[i].count = c;
                sv.area[i].data  = new ItemData_m[c];
            }
            sv.ReSize(m);
            sv.SetParent(p);
            task1 = true;
            if (load1)
            {
                ParseData.AnalyzeData(data1.ToCharArray(), ref sv.area);
                sv.Refresh();
                load1 = false;
            }
        }
Exemplo n.º 12
0
        public static void Create(SwapChain p, RawRectangleF m)//parent,margin
        {
            if (sp != null)
            {
                ReSize(m);
                return;
            }
            SetNav(0);
            Parent = p;

            nav        = new ListBox();
            nav.Hrizon = true;
            int c = nav_data.Length;

            for (int i = 0; i < c; i++)
            {
                nav.Data.Add(nav_data[i].title[0]);
            }
            nav.SelectedIndex = 0;
            nav.ItemWidth     = 60;
            nav.Forground     = new RawColor4(0.8f, 0.8f, 0.8f, 1);
            nav.BorderColor   = new RawColor4(0, 0, 0, 1);
            nav.Background    = new RawColor4(0.6f, 0.4725f, 0.4725f, 0.8f);

            RoundBorder rb = new RoundBorder();

            rb.RoundRect.RadiusX = 8;
            rb.RoundRect.RadiusY = 8;
            rb.Size = new Size2F(60, 20);

            rb.FillBrush      = BrushManage.GetLinearA();
            nav.FillTemplate  = rb;
            nav.SelectChanged = (o) => {
                var lb = o as ListBox;
                if (lb.SelectedIndex < 0)
                {
                    return;
                }
                if (lb.SelectedIndex >= 12)
                {
                    return;
                }
                FilterPanel.Visble = false;
                for (int ss = 0; ss < sp.Data.Count; ss++)
                {
                    (sp.Data[ss] as IDisposable).Dispose();
                }
                sp.Data.Clear();
                part            = 0;
                TextBar[1].Text = "1";
                SetNav(lb.SelectedIndex);
            };
            nav.ItemClick = (o) => {
                ShowOrHideFilter();
            };

            FilterPanel              = new UIViewPort();
            FilterPanel.Visble       = false;
            FilterPanel.GaussianBack = true;
            FilterPanel.Background   = new RawColor4(0, 0.1f, 0.2f, 0.4f);

            sp = new GridPanel();
            sp.ItemTemplate = DataMod.GetTemplate();
            sp.BorderColor  = new RawColor4(0, 0, 0, 1);
            create          = true;
            sp.ItemClick    = (o, e) => {
                if (sp.ClickIndex < 0)
                {
                    return;
                }
                string href = (sp.Data[sp.ClickIndex] as DataMod).href;
                if (href != null)
                {
                    VideoPage.SetAddress(href);
                }
                PageManageEx.CreateNewPage(PageTag.videopage);
            };
            lock (p.DX_Child)
            {
                p.DX_Child.Add(sp);
                p.DX_Child.Add(nav);
                p.DX_Child.Add(FilterPanel);
            }
            CreateBar(p);
            ReSize(m);
            if (load)
            {
                Analyze();
            }
        }
Exemplo n.º 13
0
 //static Border bk_ground;
 public static void Initial(SwapChain swap)
 {
     Swap = swap;
     PageManageEx.Initial(swap);
     PageManageEx.CreateNewPage(PageTag.main);
 }