コード例 #1
0
ファイル: InfoWindow.cs プロジェクト: GNOME/last-exit
        void OnUserLoaded(User user)
        {
            user_name_label.Markup = "<b>From the profile of <a href=\"" + user.Url + "\">" + StringUtils.EscapeForPango (user.Username) + "</a></b>";

            if (user.RealName == "") {
                real_name_label.Visible = false;
            } else {
                if (user.Homepage != "") {
                    real_name_label.Markup = "<a href=\"" + user.Homepage + "\">" + StringUtils.EscapeForPango (user.RealName) + "</a>";
                } else {
                    real_name_label.Markup = StringUtils.EscapeForPango (user.RealName);
                }
                real_name_label.Visible = true;
            }

            if (user.Age != 0 ||
                user.Gender != "" ||
                user.Country != "") {
                StringBuilder asl = new StringBuilder ("");
                if (user.Age != 0) {
                    asl.Append (user.Age + " years");
                }

                if (user.Gender != "") {
                    asl.Append (" / " + user.Gender);
                }

                if (user.Country != "") {
                    if (user.Age != 0 ||
                        user.Gender != "") {
                        asl.Append ("\n");
                    }

                    asl.Append (user.Country);
                }

                age_location_label.Text = asl.ToString ();
                age_location_label.Visible = true;
            } else {
                age_location_label.Visible = false;
            }

            registered_label.Text = "Member since: " + user.Registered;
            track_count_label.Text = "Tracks played: " + user.PlayCount;
        }
コード例 #2
0
ファイル: InfoWindow.cs プロジェクト: GNOME/last-exit
        public void SetSong(Song song)
        {
            this.Title = StringUtils.EscapeForPango (song.Track);
            song_label.Markup = StringUtils.EscapeForPango (song.Track);
            album_label.Markup = StringUtils.EscapeForPango (song.Album);
            artist_label.Markup = StringUtils.EscapeForPango (song.Artist);

            cover_image.ChangePixbuf (song.Image);

            if (song.StationFeed != null) {
                User user = new User (song.StationFeed);
                user.UserLoaded += new User.UserLoadedHandler (OnUserLoaded);
                user.RequestInfo ();
            }
        }