本文整理汇总了C#中IHasImages.AddImages方法的典型用法代码示例。如果您正苦于以下问题:C# IHasImages.AddImages方法的具体用法?C# IHasImages.AddImages怎么用?C# IHasImages.AddImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHasImages
的用法示例。
在下文中一共展示了IHasImages.AddImages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateMultiImages
private bool UpdateMultiImages(IHasImages item, List<LocalImageInfo> images, ImageType type)
{
var changed = false;
var newImages = images.Where(i => i.Type == type).ToList();
var newImageFileInfos = newImages
.Select(i => i.FileInfo)
.ToList();
if (item.AddImages(type, newImageFileInfos))
{
changed = true;
}
return changed;
}
示例2: UpdateMultiImages
private bool UpdateMultiImages(IHasImages item, List<LocalImageInfo> images, ImageType type)
{
var changed = false;
var backdrops = images.Where(i => i.Type == type).ToList();
if (backdrops.Count > 0)
{
var foundImages = images.Where(i => i.Type == type)
.Select(i => i.FileInfo)
.ToList();
if (foundImages.Count > 0)
{
if (item.AddImages(type, foundImages))
{
changed = true;
}
}
}
return changed;
}
示例3: MergeImages
public bool MergeImages(IHasImages item, List<LocalImageInfo> images)
{
var changed = false;
foreach (var type in _singularImages)
{
var image = images.FirstOrDefault(i => i.Type == type);
if (image != null)
{
var currentImage = item.GetImageInfo(type, 0);
if (currentImage == null || !string.Equals(currentImage.Path, image.FileInfo.FullName, StringComparison.OrdinalIgnoreCase))
{
item.SetImagePath(type, image.FileInfo);
changed = true;
}
}
}
var backdrops = images.Where(i => i.Type == ImageType.Backdrop).ToList();
if (backdrops.Count > 0)
{
var foundImages = images.Where(i => i.Type == ImageType.Backdrop)
.Select(i => i.FileInfo)
.ToList();
if (foundImages.Count > 0)
{
if (item.AddImages(ImageType.Backdrop, foundImages))
{
changed = true;
}
}
}
var hasScreenshots = item as IHasScreenshots;
if (hasScreenshots != null)
{
var foundImages = images.Where(i => i.Type == ImageType.Screenshot)
.Select(i => i.FileInfo)
.ToList();
if (foundImages.Count > 0)
{
if (item.AddImages(ImageType.Screenshot, foundImages))
{
changed = true;
}
}
}
return changed;
}