本文整理汇总了C#中IAlbum.AddMeta方法的典型用法代码示例。如果您正苦于以下问题:C# IAlbum.AddMeta方法的具体用法?C# IAlbum.AddMeta怎么用?C# IAlbum.AddMeta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAlbum
的用法示例。
在下文中一共展示了IAlbum.AddMeta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InflateAlbumFromDto
private static void InflateAlbumFromDto(IAlbum album, AlbumDto albumDto)
{
if (album == null)
throw new ArgumentNullException("album");
if (albumDto == null)
throw new ArgumentNullException("albumDto");
// A parent ID = null indicates the root album. Use int.MinValue to send to Album constructor.
int albumParentId = albumDto.FKAlbumParentId.GetValueOrDefault(Int32.MinValue);
// Assign parent if it hasn't already been assigned.
if ((album.Parent.Id == Int32.MinValue) && (albumParentId > Int32.MinValue))
{
album.Parent = CreateAlbumInstance(albumParentId, albumDto.FKGalleryId);
}
album.GalleryId = albumDto.FKGalleryId;
//album.Title = albumDto.Title;
album.DirectoryName = albumDto.DirectoryName;
//album.Summary = albumDto.Summary;
album.SortByMetaName = albumDto.SortByMetaName;
album.SortAscending = albumDto.SortAscending;
album.Sequence = albumDto.Seq;
album.DateStart = HelperFunctions.ToDateTime(albumDto.DateStart);
album.DateEnd = HelperFunctions.ToDateTime(albumDto.DateEnd);
album.CreatedByUserName = albumDto.CreatedBy.Trim();
album.DateAdded = HelperFunctions.ToDateTime(albumDto.DateAdded);
album.LastModifiedByUserName = albumDto.LastModifiedBy.Trim();
album.DateLastModified = HelperFunctions.ToDateTime(albumDto.DateLastModified);
album.OwnerUserName = albumDto.OwnedBy.Trim();
album.OwnerRoleName = albumDto.OwnerRoleName.Trim();
album.IsPrivate = albumDto.IsPrivate;
// Set the album's thumbnail media object ID. Setting this property sets an internal flag that will cause
// the media object info to be retrieved when the Thumbnail property is accessed. That's why we don't
// need to set any of the thumbnail properties.
// WARNING: No matter what, do not call DisplayObject.CreateInstance() because that creates a new object,
// and we might be executing this method from within our Thumbnail display object. Trust me, this
// creates hard to find bugs!
album.ThumbnailMediaObjectId = albumDto.ThumbnailMediaObjectId;
album.AddMeta(GalleryObjectMetadataItemCollection.FromMetaDtos(album, albumDto.Metadata));
}