Banshee.Mpris.MediaPlayer.GetIconPath C# (CSharp) Method

GetIconPath() private method

private GetIconPath ( Source source ) : string
source Source
return string
        private string GetIconPath (Source source)
        {
            string icon_name = "image-missing";
            Type icon_type = source.Properties.GetType ("Icon.Name");

            if (icon_type == typeof (string)) {
                icon_name = source.Properties.Get<string> ("Icon.Name");
            } else if (icon_type == typeof (string [])) {
                icon_name = source.Properties.Get<string[]> ("Icon.Name")[0];
            }

            string icon_path = Paths.Combine (Paths.GetInstalledDataDirectory ("icons"),
                                       "hicolor", "22x22", "categories",
                                       String.Concat (icon_name, ".png"));

            return String.Concat ("file://", icon_path);
        }