コード例 #1
0
ファイル: MusicMap.xaml.cs プロジェクト: sagar-sm/Mu3
 private void pageRoot_Loaded_1(object sender, RoutedEventArgs e)
 {
     if (MediaControl.IsPlaying)
     {
         BG1.Begin();
     }
 }
コード例 #2
0
ファイル: PlayPage.xaml.cs プロジェクト: sagar-sm/Mu3
        private void pageRoot_Loaded_1(object sender, RoutedEventArgs e)
        {
            if (MediaControl.IsPlaying)
            {
                BG1.Begin();
                id3            = Playlist.NowPlaying[0];
                SongTitle.Text = id3.Title;
                Artist.Text    = id3.Artist;
            }
            else
            {
                SongTitle.Text = "Play a song now!";
                Artist.Text    = "Swipe up from bottom for more options!";
            }

            if (Security._vault.RetrieveAll().Count != 0)
            {
                Scrobble.SetValue(AutomationProperties.NameProperty, "Last.fm Signout");
                PasswordCredential rt = Security._vault.Retrieve("Session Key", "user");
                rt.RetrievePassword();
                Globalv.session_key = rt.Password;
            }

            /*
             * if (Globalv.session_key != null)
             *  LoginBtn.Content = "Logoff";
             * else
             *  LoginBtn.Content = "Login";
             */
        }
コード例 #3
0
ファイル: MusicMap.xaml.cs プロジェクト: sagar-sm/Mu3
 private void BG1_Completed_1(object sender, object e)
 {
     if (MediaControl.IsPlaying)
     {
         BG1.Begin();
     }
 }
コード例 #4
0
ファイル: TrendsDetails.xaml.cs プロジェクト: sagar-sm/Mu3
 private void OnLoad(object sender, RoutedEventArgs e)
 {
     itemListView.ItemsSource = Globalv.GlobalTopTracks;
     if (MediaControl.IsPlaying)
     {
         BG1.Begin();
     }
 }
コード例 #5
0
ファイル: ArtistDetails.xaml.cs プロジェクト: sagar-sm/Mu3
 private void pageRoot_Loaded_1(object sender, RoutedEventArgs e)
 {
     itemListView.ItemsSource = Globalv.RecommendedArtists;
     progbar.Visibility       = Visibility.Collapsed;
     if (MediaControl.IsPlaying)
     {
         BG1.Begin();
     }
 }
コード例 #6
0
ファイル: TweetMusic.xaml.cs プロジェクト: sagar-sm/Mu3
        private async void pageRoot_Loaded_1(object sender, RoutedEventArgs e)
        {
            if (MediaControl.IsPlaying)
            {
                BG1.Begin();
            }
            progbar.Visibility = Visibility.Visible;
            string resp2 = await Twitter.Get_tweets("#NowPlaying");

            JObject jo2 = JObject.Parse(resp2);

            //try{
            for (int i = 0; i < 19; i++)
            {
                TweetViewModel tvm = new TweetViewModel();
                tvm.handle = (string)jo2["results"][i]["from_user"];
                tvm.tweet  = (string)jo2["results"][i]["text"];
                tvm.dp     = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri((string)jo2["results"][i]["profile_image_url"], UriKind.Absolute));
                ListTweetModel.Add(tvm);
            }
            itemListView2.ItemsSource = ListTweetModel;

            progbar.Visibility = Visibility.Collapsed;
        }
コード例 #7
0
ファイル: RecoArtists.xaml.cs プロジェクト: sagar-sm/Mu3
        private async void pageRoot_Loaded_1(object sender, RoutedEventArgs e)
        {
            if (MediaControl.IsPlaying)
            {
                BG1.Begin();
            }


            if (Security._vault.RetrieveAll().Count == 0)
            {
                Globalv.session_key = null;
            }
            else
            {
                PasswordCredential rt = Security._vault.Retrieve("Session Key", "user");
                rt.RetrievePassword();
                Globalv.session_key = rt.Password;
            }
            if (Globalv.session_key == null)
            {
                progbar.Visibility = Visibility.Visible;

                String lfmURL = "https://www.last.fm/api/auth/?api_key=" + Globalv.lfm_api_key + "&cb=" + EndUri;

                System.Uri StartUri = new Uri(lfmURL);

                WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(
                    WebAuthenticationOptions.None,
                    StartUri,
                    EndUri);

                if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success)
                {
                    //get and save lfm session key
                    string[] responseData = WebAuthenticationResult.ResponseData.ToString().Split('?');
                    string   token        = responseData[1].Substring(6);

                    HttpClient            cli        = new HttpClient();
                    string                getsk_sig  = "api_key" + Globalv.lfm_api_key + "methodauth.getSessiontoken" + token + "0e6e780c3cfa3faedf0c58d5aa6de92f";
                    HashAlgorithmProvider objAlgProv = HashAlgorithmProvider.OpenAlgorithm("MD5");
                    CryptographicHash     objHash    = objAlgProv.CreateHash();
                    IBuffer               buffSig    = CryptographicBuffer.ConvertStringToBinary(getsk_sig, BinaryStringEncoding.Utf8);
                    objHash.Append(buffSig);
                    IBuffer buffSighash = objHash.GetValueAndReset();

                    string api_sig = CryptographicBuffer.EncodeToHexString(buffSighash);

                    string get_sk         = @"http://ws.audioscrobbler.com/2.0/?method=auth.getSession&api_key=" + Globalv.lfm_api_key + "&api_sig=" + api_sig + "&token=" + token;
                    HttpResponseMessage r = await cli.GetAsync(get_sk);

                    string xml_resp = await r.Content.ReadAsStringAsync();

                    using (XmlReader rd = XmlReader.Create(new StringReader(xml_resp)))
                    {
                        rd.ReadToFollowing("key");

                        Globalv.session_key = rd.ReadElementContentAsString();
                        var c = new PasswordCredential("Session Key", "user", Globalv.session_key);
                        Mu3.Security._vault.Add(c);

                        /*
                         * PasswordCredential rt = Security._vault.Retrieve("Session Key", "user");
                         * rt.RetrievePassword();
                         * MessageDialog m = new MessageDialog(rt.Password);
                         * await m.ShowAsync();
                         */
                    }
                    //MessageDialog m1 = new MessageDialog(Globalv.session_key);
                    //await m1.ShowAsync();
                }
                else if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.ErrorHttp)
                {
                    MessageDialog m = new MessageDialog("HTTP Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseErrorDetail.ToString());
                    await m.ShowAsync();
                }
                else
                {
                    MessageDialog m = new MessageDialog("Error returned by AuthenticateAsync() : " + WebAuthenticationResult.ResponseStatus.ToString());
                    await m.ShowAsync();
                }
            }
            string resp = await Lastfm.user_getRecommendedArtists();

            Globalv.RecommendedArtists.Clear();
            bool success = false;

            try
            {
                using (XmlReader rd = XmlReader.Create(new StringReader(resp)))
                {
                    rd.ReadToFollowing("recommendations");
                    rd.MoveToAttribute("perPage");
                    int size = 34;

                    for (int i = 0; i < size; i++)
                    {
                        Artist ar = new Artist();
                        //rd.ReadToFollowing("artist");
                        rd.ReadToFollowing("name");
                        ar.name = rd.ReadElementContentAsString();
                        rd.ReadToNextSibling("mbid");
                        ar.mbid = rd.ReadElementContentAsString();
                        rd.ReadToNextSibling("image");
                        rd.ReadToNextSibling("image");
                        rd.ReadToNextSibling("image");
                        ar.image = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(rd.ReadElementContentAsString(), UriKind.Absolute));
                        Globalv.RecommendedArtists.Add(ar);
                    }

                    List <Artist> dps = Globalv.RecommendedArtists.Distinct().ToList();
                    itemGridView.ItemsSource = dps;
                    success = true;
                }
            }
            catch (Exception)
            {
                success = false;
            }
            if (!success)
            {
                MessageDialog m = new MessageDialog("There was some error in fetching content. Please try after sometime.", "Oops!");
                await m.ShowAsync();
            }

            progbar.Visibility = Visibility.Collapsed;
        }
コード例 #8
0
ファイル: KillSTL.xaml.cs プロジェクト: op07n/test23
        public KillSTL()
        {
            InitializeComponent();
            Height  = 500;
            Topmost = true;

            this.T20.Text = "这就是一个超级简单的、超级普通的、超级正常的养成对战类回合制文字游戏 / ?,灵感来自STL。同时这也是SSTB内涵的第一个游戏为主的彩蛋。";
            this.T19.Text = "相杀象征相爱\nBy Stapx Steve [ 林槐 ] @2019 / 版权所有";

            setTitle(version);
            this.T2.Text  = "Version - " + version;
            this.T18.Text = "Version - " + version;

            WindowXCaption.SetBackground(this, baseColora.Main);
            WindowXCaption.SetForeground(this, baseColora.FontM);

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            BG1.BeginInit();
            BG1.Source = baseColora.Bgpa;
            BG1.EndInit();
            BG2.BeginInit();
            BG2.Source = baseColora.Bgpa;
            BG2.EndInit();

            this.TT.Foreground = baseColora.Main;

            this.T.Foreground   = baseColora.Fg;
            this.T1.Foreground  = baseColora.Fg;
            this.T2.Foreground  = baseColora.Fg;
            this.T3.Foreground  = baseColora.Fg;
            this.T4.Foreground  = baseColora.Fg;
            this.T5.Foreground  = baseColora.Fg;
            this.T6.Foreground  = baseColora.Fg;
            this.T7.Foreground  = baseColora.Fg;
            this.T8.Foreground  = baseColora.Fg;
            this.T9.Foreground  = baseColora.Fg;
            this.T10.Foreground = baseColora.Fg;
            this.T11.Foreground = baseColora.Fg;
            this.T12.Foreground = baseColora.Fg;
            this.T13.Foreground = baseColora.Fg;
            this.T14.Foreground = baseColora.Fg;
            this.T15.Foreground = baseColora.Fg;
            this.T16.Foreground = baseColora.Fg;
            this.T17.Foreground = baseColora.Fg;
            this.T18.Foreground = baseColora.Fg;
            this.T19.Foreground = baseColora.Fg;
            this.T20.Foreground = baseColora.Fg;

            this.TopIcon.Background = baseColora.Main;
            this.TopIcon.Foreground = baseColora.FontM;
            ButtonHelper.SetHoverBrush(TopIcon, baseColora.Main);
            ButtonHelper.SetClickCoverOpacity(TopIcon, 1);

            this.RunButton.Foreground = baseColora.Font;
            this.RunButton.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(RunButton, baseColora.Main);
            this.Pass.Foreground = baseColora.Font;
            this.Pass.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(Pass, baseColora.Main);
            this.Exit.Foreground = baseColora.Font;
            this.Exit.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(Exit, baseColora.Main);
            this.Hits.Foreground = baseColora.Font;
            this.Hits.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(Hits, baseColora.Main);

            this.MainTab.Background = baseColora.Bg;
            this.MainTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(MainTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(MainTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(MainTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(MainTab, baseColora.Fg);
            this.GameTab.Background = baseColora.Bg;
            this.GameTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(GameTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(GameTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(GameTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(GameTab, baseColora.Fg);

            this.Hit.Background = baseColora.DBg;
            this.Hit.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Hit, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Hit, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Hit, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Hit, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Hit, baseColora.Fg);
            this.Do.Background = baseColora.DBg;
            this.Do.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Do, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Do, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Do, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Do, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Do, baseColora.Fg);
            this.Give.Background = baseColora.DBg;
            this.Give.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Give, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Give, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Give, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Give, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Give, baseColora.Fg);

            this.BagBD.Background = baseColora.DBg;
            ListViewItem listViewItem = new ListViewItem();

            listViewItem.Name = "空";
            TextBlock textBlock = new TextBlock();

            textBlock.Text       = "  空";
            textBlock.Foreground = baseColora.Font;
            textBlock.FontSize   = 14;
            listViewItem.Content = textBlock;
            Bag.Items.Add(listViewItem);

            this.Health.Background = baseColora.DBg;
            this.Health.Foreground = baseColora.Main;
            this.Love.Background   = baseColora.DBg;
            this.Love.Foreground   = baseColora.Main;
            this.Hug.Background    = baseColora.DBg;
            this.Hug.Foreground    = baseColora.Main;
            this.Duang.Background  = baseColora.DBg;
            this.Duang.Foreground  = baseColora.Main;

            this.yHealth.Background = baseColora.DBg;
            this.yHealth.Foreground = baseColora.Main;
            this.yLove.Background   = baseColora.DBg;
            this.yLove.Foreground   = baseColora.Main;
            this.yHug.Background    = baseColora.DBg;
            this.yHug.Foreground    = baseColora.Main;
            this.yDuang.Background  = baseColora.DBg;
            this.yDuang.Foreground  = baseColora.Main;

            this.Run.Background = baseColora.DBg;
            this.Run.Foreground = baseColora.Fg;

            CMD.Foreground    = baseColora.Font;
            CMDCOL.Foreground = baseColora.Font;

            this.MainGame.Visibility = Visibility.Collapsed;

            CMDIN.Visibility = Visibility.Collapsed;

            if (PageHD2.opin)
            {
                you = "Stapx Steve";
                op  = true;
            }

            customHit.Add(new customerHit()
            {
                ID = 0, Name = "  - 空 -", ShowName = "空", Hit = 0, HitMax = 0, Love = 0, LoveMax = 0, Hug = 0, HugMax = 0, Duang = 0, DuangMax = 0
            });
            customHit.Add(new customerHit()
            {
                ID = 1, Name = "  - 轻拳 -", ShowName = "轻拳", Hit = -10, HitMax = -5, Love = -1, LoveMax = 0, Hug = -45, HugMax = -25, Duang = 1, DuangMax = 2
            });
            Hit.ItemsSource       = customHit;
            Hit.DisplayMemberPath = "Name";
            Hit.SelectedValuePath = "ID";
            Hit.SelectedValue     = 0;

            customGive.Add(new customerGive()
            {
                ID = 0, Name = "  - 空 -", ShowName = "空", Hit = 0, HitMax = 0, Love = 0, LoveMax = 0, Hug = 0, HugMax = 0, Buff = "", BuffPes = 0
            });
            customGive.Add(new customerGive()
            {
                ID = 1, Name = "  - 面包 -", ShowName = "面包", Hit = 0, HitMax = 0, Love = 0, LoveMax = 2, Hug = 10, HugMax = 10, Buff = "吃撑", BuffPes = 5
            });
            Give.ItemsSource       = customGive;
            Give.DisplayMemberPath = "Name";
            Give.SelectedValuePath = "ID";
            Give.SelectedValue     = 0;

            customDo.Add(new customerDo()
            {
                ID = 0, Name = "  - 空 -", ShowName = "空", Hit = 0, HitMax = 0, Love = 0, LoveMax = 0, Hug = 0, HugMax = 0, Buff = "", BuffPes = 0
            });
            customDo.Add(new customerDo()
            {
                ID = 1, Name = "  - 捏捏 -", ShowName = "捏捏", Hit = 0, HitMax = 0, Love = 0, LoveMax = 2, Hug = -5, HugMax = -2, Buff = "", BuffPes = 0
            });
            Do.ItemsSource       = customDo;
            Do.DisplayMemberPath = "Name";
            Do.SelectedValuePath = "ID";
            Do.SelectedValue     = 0;
        }
コード例 #9
0
ファイル: PlayPage.xaml.cs プロジェクト: sagar-sm/Mu3
        private async void Collection_Click_1(object sender, RoutedEventArgs e)
        {
            if (EnsureUnsnapped())
            {
                FileOpenPicker pkr = new FileOpenPicker();
                pkr.ViewMode = PickerViewMode.List;
                pkr.SuggestedStartLocation = PickerLocationId.MusicLibrary;
                pkr.FileTypeFilter.Add(".mp3");

                StorageFile file = await pkr.PickSingleFileAsync();

                if (null != file)
                {
                    var strm = await file.OpenAsync(FileAccessMode.Read);

                    Playlist.NowPlaying.Clear();
                    App.GlobalAudioElement.AudioCategory = Windows.UI.Xaml.Media.AudioCategory.BackgroundCapableMedia;
                    //mediaPlayer.SetSource(strm, file.ContentType);
                    App.GlobalAudioElement.SetSource(strm, file.ContentType);
                    App.GlobalAudioElement.Play();
                    //timelineSlider.Maximum = App.GlobalAudioElement.NaturalDuration.TimeSpan.TotalMilliseconds;
                    isScrobbledOnce = false;

                    MediaControl.IsPlaying = true;
                    BG1.Begin();
                    //PlayPauseBtn.Content = "";

                    id3 = await file.Properties.GetMusicPropertiesAsync();

                    SongTitle.Text          = id3.Title;
                    Artist.Text             = id3.Artist;
                    MediaControl.ArtistName = id3.Artist;
                    MediaControl.TrackName  = id3.Title;
                    Playlist.NowPlaying.Add(id3);
                    Lastfm.track_updateNowPlaying(id3);

                    string xmlinfo = await Lastfm.track_getInfo(id3);

                    string artistinfo = await Lastfm.artist_getInfo(id3.Artist);

                    try
                    {
                        using (XmlReader rd = XmlReader.Create(new StringReader(xmlinfo)))
                        {
                            rd.ReadToFollowing("name");
                            //TitleInfoTbx.Text = rd.ReadElementContentAsString();
                            rd.ReadToFollowing("artist");
                            rd.ReadToDescendant("name");
                            //SubtitleInfoTbx.Text = rd.ReadElementContentAsString();
                        }

                        Uri src;
                        using (XmlReader rd = XmlReader.Create(new StringReader(xmlinfo)))
                        {
                            rd.ReadToFollowing("image");
                            rd.ReadToNextSibling("image");
                            rd.ReadToNextSibling("image");
                            src = new Uri(rd.ReadElementContentAsString(), UriKind.Absolute);
                            AlbumArtHolder.Source = new BitmapImage(src);
                        }
                        using (XmlReader rd = XmlReader.Create(new StringReader(xmlinfo)))
                        {
                            rd.ReadToFollowing("wiki");
                            rd.ReadToDescendant("summary");
                            string text = rd.ReadElementContentAsString();

                            SummaryInfoTbx.Text = HtmlUtilities.ConvertToText(text);
                        }
                    }
                    catch (Exception)
                    {
                        try
                        {
                            using (XmlReader rd = XmlReader.Create(new StringReader(artistinfo)))
                            {
                                rd.ReadToFollowing("image");
                                rd.ReadToNextSibling("image");
                                rd.ReadToNextSibling("image");
                                Uri src = new Uri(rd.ReadElementContentAsString(), UriKind.Absolute);
                                AlbumArtHolder.Source = new BitmapImage(src);
                                MediaControl.AlbumArt = src;
                            }
                        }
                        catch (Exception)
                        {
                            AlbumArtHolder.Source = null;
                        }
                    }
                    //prepare for scrobble
                    TimelineMarker tlm = new TimelineMarker();
                    tlm.Time = new System.TimeSpan(0, 0, (int)id3.Duration.TotalSeconds / 2);
                    App.GlobalAudioElement.Markers.Clear();
                    App.GlobalAudioElement.Markers.Add(tlm);
                    if (id3.Duration > new System.TimeSpan(0, 0, 30))
                    {
                        await Lastfm.track_scrobble(id3);

                        isScrobbledOnce = true;

                        //App.GlobalAudioElement.MarkerReached += mediaPlayer_MarkerReached_scrobble; //scrobble
                    }
                }
                else
                {
                    return;
                }
            }
        }
コード例 #10
0
 public void RysujOkrag(double x, double y, double r)
 {
     BG1.rysuj_okrag(x, y, r);
 }
コード例 #11
0
 public void RysujLinie(double x1, double x2, double y1, double y2)
 {
     BG1.rysuj_linie(x1, x2, y1, y2);
 }
コード例 #12
0
        private async void pageRoot_Loaded_1(object sender, RoutedEventArgs e)
        {
            if (MediaControl.IsPlaying)
            {
                BG1.Begin();
            }

            if (Globalv.GlobalTopTracks.Count == 0)
            {
                progbar.Visibility = Visibility.Visible;
                bool success = false;
                try
                {
                    string resp = await Lastfm.chart_topTracks();

                    using (XmlReader rd = XmlReader.Create(new StringReader(resp)))
                    {
                        //for headliner
                        rd.ReadToFollowing("name");
                        GroupName = rd.ReadElementContentAsString();
                        rd.ReadToFollowing("playcount");
                        long pc = rd.ReadElementContentAsLong();
                        rd.ReadToFollowing("listeners");
                        long listeners = rd.ReadElementContentAsLong();
                        rd.ReadToFollowing("artist");
                        rd.ReadToDescendant("name");
                        string artist = rd.ReadElementContentAsString();
                        GroupDescription = "Artist: " + artist + "\nTrack heard over " + pc.ToString() + " times by " + listeners.ToString() + " listeners worldwide.";
                        Song s = new Song();
                        s.Artist = artist;
                        s.Title  = GroupName;
                        string resp2 = await Lastfm.track_getInfo(s);

                        using (XmlReader rd2 = XmlReader.Create(new StringReader(resp2)))
                        {
                            rd2.ReadToFollowing("album");
                            rd2.ReadToDescendant("image");
                            rd2.ReadToNextSibling("image");
                            rd2.ReadToNextSibling("image");

                            GroupImage = new BitmapImage(new Uri(rd2.ReadElementContentAsString(), UriKind.Absolute));
                        }
                        GNameTb.Text  = GroupName;
                        GImage.Source = GroupImage;
                        GDesc.Text    = GroupDescription;

                        //for other items
                        for (int i = 0; i < 19; i++)
                        {
                            //for headliner
                            Song s2 = new Song();
                            rd.ReadToFollowing("name");
                            s2.Title = rd.ReadElementContentAsString();
                            rd.ReadToFollowing("playcount");
                            long pclist = rd.ReadElementContentAsLong();
                            rd.ReadToFollowing("listeners");
                            long listenerslist = rd.ReadElementContentAsLong();
                            rd.ReadToFollowing("artist");
                            rd.ReadToDescendant("name");
                            s2.Artist  = rd.ReadElementContentAsString();
                            s2.content = "Artist: " + s2.Artist + "\nTrack heard over " + pclist.ToString() + " times by " + listenerslist.ToString() + " listeners worldwide.";
                            string resp22 = await Lastfm.track_getInfo(s2);

                            try
                            {
                                using (XmlReader rd2 = XmlReader.Create(new StringReader(resp22)))
                                {
                                    rd2.ReadToFollowing("album");
                                    rd2.ReadToFollowing("image");
                                    rd2.ReadToNextSibling("image");
                                    rd2.ReadToNextSibling("image");
                                    s2.image = new BitmapImage(new Uri(rd2.ReadElementContentAsString(), UriKind.Absolute));
                                }
                            }
                            catch (Exception) { }
                            TopTracks.Add(s2);
                        }
                        itemsGridView.ItemsSource = TopTracks;
                        Globalv.GlobalTopTracks   = TopTracks;
                    }
                    success = true;
                }
                catch (Exception)
                { success = false; }

                if (!success)
                {
                    MessageDialog m = new MessageDialog("This feature requires you to be connected to the internet. Connect to the internet and try again", "You're offline");
                    await m.ShowAsync();
                }
                progbar.Visibility = Visibility.Collapsed;
            }
            else
            {
                itemsGridView.ItemsSource = TopTracks;
            }
        }
コード例 #13
0
ファイル: About.xaml.cs プロジェクト: op07n/test23
        public About()
        {
            InitializeComponent();

            WindowXCaption.SetBackground(this, baseColora.Main);
            WindowXCaption.SetForeground(this, baseColora.FontM);

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            BG1.BeginInit();
            BG1.Source = baseColora.Bgpa;
            BG1.EndInit();
            BG2.BeginInit();
            BG2.Source = baseColora.Bgpa;
            BG2.EndInit();

            this.MainTab.Background = baseColora.Bg;
            this.MainTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(MainTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(MainTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(MainTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(MainTab, baseColora.Fg);

            ButtonHelper.SetHoverBrush(B1, baseColora.Bg);
            IconHelper.SetForeground(B1, baseColora.Fg);
            this.B1.Foreground = baseColora.Fg;
            this.B1.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B2, baseColora.Fg);
            IconHelper.SetForeground(B2, baseColora.Fg);
            this.B2.Foreground = baseColora.Fg;
            this.B2.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B3, baseColora.Bg);
            IconHelper.SetForeground(B3, baseColora.Fg);
            this.B3.Foreground = baseColora.Fg;
            this.B3.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B4, baseColora.Bg);
            IconHelper.SetForeground(B4, baseColora.Fg);
            this.B4.Foreground = baseColora.Fg;
            this.B4.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B5, baseColora.Bg);
            IconHelper.SetForeground(B5, baseColora.Fg);
            this.B5.Foreground = baseColora.Fg;
            this.B5.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B6, baseColora.Bg);
            IconHelper.SetForeground(B6, baseColora.Fg);
            this.B6.Foreground = baseColora.Fg;
            this.B6.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B7, baseColora.Bg);
            IconHelper.SetForeground(B7, baseColora.Fg);
            this.B7.Foreground = baseColora.Fg;
            this.B7.Background = baseColora.Tran;

            this.CD1.Background = baseColora.Bg;
            this.CD2.Background = baseColora.Bg;
            this.CD3.Background = baseColora.Bg;
            this.CD4.Background = baseColora.Bg;

            //SS列表样式
            this.SS.Foreground  = baseColora.Fg;
            this.SS.FontFamily  = baseColora.Fonts;
            this.SS.FontSize    = 22;
            this.BLC.Foreground = baseColora.Fg;
            this.BLC.FontFamily = baseColora.Fonts;
            this.BLC.FontSize   = 22;

            this.WhoSS.Text        = "       这是一只喜欢做UI排版的SS,喜欢折腾。有事没事就想做点什么……然而大半都做不完的说,米粉、谷歌粉,会卖萌/大雾,没什么事的话可以陪聊(?) ,QQ , Twitter都行/逃。";
            this.WhoBLC.Text       = "       [ 这个人什么都没留下 ]";
            this.WhoSS.Foreground  = baseColora.Fg;
            this.WhoSS.FontFamily  = baseColora.Fonts;
            this.WhoSS.FontSize    = 14;
            this.WhoBLC.Foreground = baseColora.Fg;
            this.WhoBLC.FontFamily = baseColora.Fonts;
            this.WhoBLC.FontSize   = 14;

            this.MT1.Foreground = baseColora.Fg;
            this.MT1.FontFamily = baseColora.Fonts;
            this.MT1.FontSize   = 15;
            this.MT2.Foreground = baseColora.Fg;
            this.MT2.FontFamily = baseColora.Fonts;
            this.MT2.FontSize   = 15;
            this.MT3.Foreground = baseColora.Fg;
            this.MT3.FontFamily = baseColora.Fonts;
            this.MT3.FontSize   = 15;
            this.MT4.Foreground = baseColora.Fg;
            this.MT4.FontFamily = baseColora.Fonts;
            this.MT4.FontSize   = 15;

            this.S1.Foreground = baseColora.Fg;
            this.S1.FontFamily = baseColora.Fonts;
            this.S1.FontSize   = 13;
            this.S2.Foreground = baseColora.Fg;
            this.S2.FontFamily = baseColora.Fonts;
            this.S2.FontSize   = 13;
            this.S3.Foreground = baseColora.Fg;
            this.S3.FontFamily = baseColora.Fonts;
            this.S3.FontSize   = 13;
            this.S4.Foreground = baseColora.Fg;
            this.S4.FontFamily = baseColora.Fonts;
            this.S4.FontSize   = 13;
        }
コード例 #14
0
        private bool UpdateUI()
        {
            WindowXCaption.SetBackground(this, baseColora.Main);
            WindowXCaption.SetForeground(this, baseColora.FontM);

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            BG1.BeginInit();
            BG1.Source = baseColora.Bgpa;
            BG1.EndInit();
            BG2.BeginInit();
            BG2.Source = baseColora.Bgpa;
            BG2.EndInit();
            BG3.BeginInit();
            BG3.Source = baseColora.Bgpa;
            BG3.EndInit();

            //样式
            this.T11.Foreground = baseColora.Fg;
            this.T11.FontFamily = baseColora.Fonts;
            this.T11.FontSize   = 13;
            this.T12.Foreground = baseColora.Fg;
            this.T12.FontFamily = baseColora.Fonts;
            this.T12.FontSize   = 13;
            this.T13.Foreground = baseColora.Fg;
            this.T13.FontFamily = baseColora.Fonts;
            this.T13.FontSize   = 13;
            this.T14.Foreground = baseColora.Fg;
            this.T14.FontFamily = baseColora.Fonts;
            this.T14.FontSize   = 13;
            this.T15.Foreground = baseColora.Fg;
            this.T15.FontFamily = baseColora.Fonts;
            this.T15.FontSize   = 13;
            this.T16.Foreground = baseColora.Fg;
            this.T16.FontFamily = baseColora.Fonts;
            this.T16.FontSize   = 13;
            this.T17.Foreground = baseColora.Fg;
            this.T17.FontFamily = baseColora.Fonts;
            this.T17.FontSize   = 13;
            this.T18.Foreground = baseColora.Fg;
            this.T18.FontFamily = baseColora.Fonts;
            this.T18.FontSize   = 13;
            this.T21.Foreground = baseColora.Fg;
            this.T21.FontFamily = baseColora.Fonts;
            this.T21.FontSize   = 13;
            this.T22.Foreground = baseColora.Fg;
            this.T22.FontFamily = baseColora.Fonts;
            this.T22.FontSize   = 13;
            this.T31.Foreground = baseColora.Fg;
            this.T31.FontFamily = baseColora.Fonts;
            this.T31.FontSize   = 13;
            this.T41.Foreground = baseColora.Fg;
            this.T41.FontFamily = baseColora.Fonts;
            this.T41.FontSize   = 13;

            this.MT11.Foreground = baseColora.Fg;
            this.MT11.FontFamily = baseColora.Fonts;
            this.MT11.FontSize   = 15;
            this.MT12.Foreground = baseColora.Fg;
            this.MT12.FontFamily = baseColora.Fonts;
            this.MT12.FontSize   = 15;
            this.MT13.Foreground = baseColora.Fg;
            this.MT13.FontFamily = baseColora.Fonts;
            this.MT13.FontSize   = 15;
            this.MT21.Foreground = baseColora.Fg;
            this.MT21.FontFamily = baseColora.Fonts;
            this.MT21.FontSize   = 15;
            this.MT31.Foreground = baseColora.Fg;
            this.MT31.FontFamily = baseColora.Fonts;
            this.MT31.FontSize   = 15;
            this.MT41.Foreground = baseColora.Fg;
            this.MT41.FontFamily = baseColora.Fonts;
            this.MT41.FontSize   = 15;

            this.CD11.Background = baseColora.Bg;
            this.CD12.Background = baseColora.Bg;
            this.CD13.Background = baseColora.Bg;
            this.CD21.Background = baseColora.Bg;
            this.CD32.Background = baseColora.Bg;
            this.CD41.Background = baseColora.Bg;

            this.C11.Background = baseColora.DBg;
            this.C31.Background = baseColora.DBg;
            this.C32.Background = baseColora.DBg;
            CheckBoxHelper.SetCheckedBackground(C11, baseColora.DBg);
            CheckBoxHelper.SetCheckedBackground(C31, baseColora.DBg);
            CheckBoxHelper.SetCheckedBackground(C32, baseColora.DBg);
            CheckBoxHelper.SetGlyphBrush(C11, baseColora.DBg);
            CheckBoxHelper.SetGlyphBrush(C31, baseColora.DBg);
            CheckBoxHelper.SetGlyphBrush(C32, baseColora.DBg);
            CheckBoxHelper.SetCheckedGlyphBrush(C11, baseColora.Main);
            CheckBoxHelper.SetCheckedGlyphBrush(C31, baseColora.Main);
            CheckBoxHelper.SetCheckedGlyphBrush(C32, baseColora.Main);

            this.MainTab.Background = baseColora.Bg;
            this.MainTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(MainTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(MainTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(MainTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(MainTab, baseColora.Fg);

            this.Theams.Background = baseColora.DBg;
            this.Theams.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Theams, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Theams, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Theams, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Theams, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Theams, baseColora.Fg);

            this.S11.Background = baseColora.DBg;
            this.S11.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S11, baseColora.Main);
            this.S12.Background = baseColora.DBg;
            this.S12.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S12, baseColora.Main);
            this.S13.Background = baseColora.DBg;
            this.S13.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S13, baseColora.Main);
            this.S14.Background = baseColora.DBg;
            this.S14.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S14, baseColora.Main);

            this.TopIcon.Background = baseColora.Main;
            this.TopIcon.Foreground = baseColora.FontM;
            ButtonHelper.SetHoverBrush(TopIcon, baseColora.Main);
            ButtonHelper.SetClickCoverOpacity(TopIcon, 1);
            this.MBG.Foreground = baseColora.Fg;
            this.MBG.Background = baseColora.DBg;
            this.SBG.Foreground = baseColora.Fg;
            this.SBG.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(MBG, baseColora.DBg);
            ButtonHelper.SetHoverBrush(SBG, baseColora.DBg);
            this.B21.Foreground = baseColora.Fg;
            this.B21.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(B21, baseColora.DBg);
            this.B41.Foreground = baseColora.Fg;
            this.B41.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(B41, baseColora.DBg);

            this.Password.Background  = baseColora.Bg;
            this.Password.Foreground  = baseColora.Fg;
            this.UpdateLog.Background = baseColora.Bg;
            this.UpdateLog.Foreground = baseColora.Fg;

            return(true);
        }