本文整理汇总了C#中BaseItem.GetImages方法的典型用法代码示例。如果您正苦于以下问题:C# BaseItem.GetImages方法的具体用法?C# BaseItem.GetImages怎么用?C# BaseItem.GetImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseItem
的用法示例。
在下文中一共展示了BaseItem.GetImages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AttachBasicFields
/// <summary>
/// Sets simple property values on a DTOBaseItem
/// </summary>
/// <param name="dto">The dto.</param>
/// <param name="item">The item.</param>
/// <param name="owner">The owner.</param>
/// <param name="options">The options.</param>
private void AttachBasicFields(BaseItemDto dto, BaseItem item, BaseItem owner, DtoOptions options)
{
var fields = options.Fields;
if (fields.Contains(ItemFields.DateCreated))
{
dto.DateCreated = item.DateCreated;
}
if (fields.Contains(ItemFields.DisplayMediaType))
{
dto.DisplayMediaType = item.DisplayMediaType;
}
if (fields.Contains(ItemFields.Settings))
{
dto.LockedFields = item.LockedFields;
dto.LockData = item.IsLocked;
dto.ForcedSortName = item.ForcedSortName;
}
dto.Container = item.Container;
var hasBudget = item as IHasBudget;
if (hasBudget != null)
{
if (fields.Contains(ItemFields.Budget))
{
dto.Budget = hasBudget.Budget;
}
if (fields.Contains(ItemFields.Revenue))
{
dto.Revenue = hasBudget.Revenue;
}
}
dto.EndDate = item.EndDate;
if (fields.Contains(ItemFields.HomePageUrl))
{
dto.HomePageUrl = item.HomePageUrl;
}
if (fields.Contains(ItemFields.ExternalUrls))
{
dto.ExternalUrls = _providerManager.GetExternalUrls(item).ToArray();
}
if (fields.Contains(ItemFields.Tags))
{
dto.Tags = item.Tags;
}
if (fields.Contains(ItemFields.Keywords))
{
dto.Keywords = item.Keywords;
}
var hasAspectRatio = item as IHasAspectRatio;
if (hasAspectRatio != null)
{
dto.AspectRatio = hasAspectRatio.AspectRatio;
}
if (fields.Contains(ItemFields.Metascore))
{
var hasMetascore = item as IHasMetascore;
if (hasMetascore != null)
{
dto.Metascore = hasMetascore.Metascore;
}
}
if (fields.Contains(ItemFields.AwardSummary))
{
var hasAwards = item as IHasAwards;
if (hasAwards != null)
{
dto.AwardSummary = hasAwards.AwardSummary;
}
}
var backdropLimit = options.GetImageLimit(ImageType.Backdrop);
if (backdropLimit > 0)
{
dto.BackdropImageTags = GetImageTags(item, item.GetImages(ImageType.Backdrop).Take(backdropLimit).ToList());
}
if (fields.Contains(ItemFields.ScreenshotImageTags))
{
var screenshotLimit = options.GetImageLimit(ImageType.Screenshot);
if (screenshotLimit > 0)
{
//.........这里部分代码省略.........
示例2: GetCacheTags
private IEnumerable<string> GetCacheTags(BaseItem item, ImageType type, int limit)
{
return item.GetImages(type)
.Select(p => GetImageCacheTag(item, p))
.Where(i => i != null)
.Take(limit)
.ToList();
}
示例3: GetCacheTags
private IEnumerable<Guid> GetCacheTags(BaseItem item, ImageType type)
{
return item.GetImages(type)
.Select(p => GetImageCacheTag(item, p))
.Where(i => i.HasValue)
.Select(i => i.Value)
.ToList();
}