当前位置: 首页>>代码示例>>C#>>正文


C# Song.RequestImage方法代码示例

本文整理汇总了C#中Song.RequestImage方法的典型用法代码示例。如果您正苦于以下问题:C# Song.RequestImage方法的具体用法?C# Song.RequestImage怎么用?C# Song.RequestImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Song的用法示例。


在下文中一共展示了Song.RequestImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMetadataCompleted

        private void OnMetadataCompleted(Song song)
        {
            string station_id = Driver.connection.StationLocation;
            current_song = song;

            love_button.Sensitive = true;
            hate_button.Sensitive = true;
            tag_button.Sensitive = true;
            journal_button.Sensitive = true;
            info_button.Sensitive = true;
            progress_label.Markup = "";
            progress_label.Visible = true;

            if (station_id != null) {
                if (known_stations.Contains (station_id) == false) {
                    string name;

                    if (station_id.StartsWith ("lastfm://play")) {
                        // This is a 30 second preview
                        // but the station name isn't very
                        // descriptive..Make it better.

                        name = song.Artist + " (" + song.Station + ")";
                    } else {
                        name = song.Station;
                    }

                    add_custom_station (null, name,
                                station_id, true);
                    select_station (station_id);
                } else {
                    // Irritating code to deal with
                    // the payola adverts on last.fm now.
                    set_station_title (station_id, song.Station);
                }
            }

            trayicon.FillPopup (song);

            song.ImageLoaded += new Song.ImageLoadedHandler (OnCoverLoaded);
            if (song.Track != null) {
                song_label.Markup = "<span weight=\"bold\"><a href=\"" + song.TrackUrl + "\">" + StringUtils.EscapeForPango (song.Track) + "</a></span>";
            } else {
                song_label.Markup = "<span weight=\"bold\"> </span>";
            }

            if (song.Album != null && song.Artist != null) {
                artist_label.Markup = String.Format(Catalog.GetString("<span size=\"smaller\">From <a href=\"{0}\">{1}</a> by <a href=\"{2}\">{3}</a></span>"), song.AlbumUrl, StringUtils.EscapeForPango (song.Album), song.ArtistUrl, StringUtils.EscapeForPango (song.Artist));
            } else if (song.Album == null) {
                artist_label.Markup = String.Format(Catalog.GetString("<span size=\"smaller\">By <a href=\"{0}\">{1}</a></span>"), song.ArtistUrl, StringUtils.EscapeForPango (song.Artist));
            } else if (song.Artist == null) {
                artist_label.Markup = String.Format(Catalog.GetString("<span size=\"smaller\">From <a href=\"{0}\">{1}</a></span>"), song.AlbumUrl, StringUtils.EscapeForPango (song.Album));
            } else {
                artist_label.Markup = "<span size=\"smaller\"> </span>";
            }

            song.RequestImage (Driver.CoverSize, Driver.CoverSize);

            this.Title = String.Format(Catalog.GetString("{0} by {1}"), song.Track, song.Artist);

            love_button.Sensitive = true;
            hate_button.Sensitive = true;

            if (i_window != null) {
                i_window.SetSong (song);
            }

            GLib.Timeout.Add (250, new GLib.TimeoutHandler (adjust_progress_label_callback));
        }
开发者ID:GNOME,项目名称:last-exit,代码行数:69,代码来源:PlayerWindow.cs


注:本文中的Song.RequestImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。