当前位置: 首页>>代码示例>>C#>>正文


C# IAlbum.AddMeta方法代码示例

本文整理汇总了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));
		}
开发者ID:Jiyuu,项目名称:galleryserverpro,代码行数:44,代码来源:Factory.cs


注:本文中的IAlbum.AddMeta方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。