示例#1
0
        public MediaItemBuilder(ISecurityContext securityContext, IMediaFactory mediaFactory, T item)
        {
            if (securityContext == null)
            {
                throw new ArgumentNullException("securityContext");
            }
            if (mediaFactory == null)
            {
                throw new ArgumentNullException("mediaFactory");
            }

            this.securityContext = securityContext;
            this.mediaFactory    = mediaFactory;

            if (item != null)
            {
                this.identityInfo  = new IdentityInfo(item.Location, item.Type, item.Name, item.Summary, item.FromDate, item.ToDate, item.Number);
                this.sizeInfo      = new SizeInfo(item.Duration, item.Height, item.Width);
                this.creatorInfo   = new CreatorInfo(item.Creator, item.CreatorName);
                this.catalogInfo   = new CatalogInfo(item.Catalog, item.CatalogName);
                this.targetInfo    = new TargetInfo(item.Target, item.TargetType);
                this.userInfo      = new UserInfo(item.User, item.UserName);
                this.thumbnailInfo = new ThumbnailInfo(item.Thumbnail, item.ThumbnailData);
            }
            else
            {
                this.identityInfo = IdentityInfo.GetDefault(GetMediaType());
                this.userInfo     = securityContext.CurrentUserInfo;
            }

            InitializeCreateFunction();
        }
示例#2
0
 public T GetDefault()
 {
     return((T)createFunction(IdentityInfo.GetDefault(GetMediaType()), SizeInfo.Default, CreatorInfo.Default, CatalogInfo.Default, TargetInfo.Default, UserInfo.Default, ThumbnailInfo.Default));
 }