public static MvcHtmlString PVServiceIcons(this HtmlHelper htmlHelper, PVServices services) { var sb = new StringBuilder(); if (services.HasFlag(PVServices.NicoNicoDouga)) { sb.Append(Image(htmlHelper, VideoServiceLinkUrl(htmlHelper, PVService.NicoNicoDouga), "NicoNicoDouga")); } if (services.HasFlag(PVServices.Youtube)) { sb.Append(Image(htmlHelper, VideoServiceLinkUrl(htmlHelper, PVService.Youtube), "Youtube")); } return(new MvcHtmlString(sb.ToString())); }
protected string GetPvUrl(Song song, PVType?type, PVServices services) { var pv = song.PVs.FirstOrDefault(p => (type == null || p.PVType == type) && services.HasFlag((PVServices)p.Service)); return(pv != null ? pv.Url : string.Empty); }