Esempio n. 1
0
        public virtual RepositoryItemVersion CreateFirstVersion()
        {
            RepositoryItemVersion version = new RepositoryItemVersion();

            version.Availability = Availability;
            version.CreateMetaInfo(IdCreatedBy, CreatorIpAddress, CreatorProxyIpAddress, CreatedOn);
            version.Deleted         = DomainModel.BaseStatusDeleted.None;
            version.DisplayMode     = DisplayMode;
            version.Downloaded      = Downloaded;
            version.File            = this;
            version.IdCommunity     = IdCommunity;
            version.IdPlayer        = IdPlayer;
            version.IsActive        = true;
            version.Number          = 0;
            version.IdOwner         = IdOwner;
            version.PreviewTime     = PreviewTime;
            version.Size            = Size;
            version.Status          = Status;
            version.Thumbnail       = Thumbnail;
            version.AutoThumbnail   = AutoThumbnail;
            version.Time            = Time;
            version.Type            = Type;
            version.UniqueIdItem    = UniqueId;
            version.UniqueIdVersion = UniqueId;
            version.Name            = Name;
            version.Description     = Description;
            version.Url             = Url;
            version.Extension       = Extension;
            version.ContentType     = ContentType;
            version.Repository      = Repository;
            return(version);
        }
Esempio n. 2
0
        public static RepositoryItemVersion CreateNewVersion(RepositoryItem file, dtoUploadedItem versionToAdd, Int32 idUser, String ipAddress, String proxyIpAddress)
        {
            RepositoryItemVersion version = new RepositoryItemVersion();

            version.Availability = ItemAvailability.available;
            version.CreateMetaInfo(idUser, ipAddress, proxyIpAddress);
            version.Deleted     = DomainModel.BaseStatusDeleted.None;
            version.DisplayMode = file.DisplayMode;
            version.Downloaded  = 0;
            version.File        = file;
            version.IdCommunity = file.IdCommunity;
            version.IdPlayer    = file.IdPlayer;
            version.IsActive    = true;
            version.Number      = file.Number + 1;
            version.IdOwner     = file.IdOwner;
            version.PreviewTime = file.PreviewTime;
            version.Size        = versionToAdd.Size;
            version.Status      = file.Status;
            if (versionToAdd.HasThumbnail)
            {
                version.Thumbnail     = versionToAdd.ThumbnailFileName;
                version.AutoThumbnail = versionToAdd.AutoThumbnail;
                file.Thumbnail        = versionToAdd.ThumbnailFileName;
                file.AutoThumbnail    = versionToAdd.AutoThumbnail;
            }
            else
            {
                version.Thumbnail     = (file.AutoThumbnail ? "" : file.Thumbnail);
                version.AutoThumbnail = file.AutoThumbnail;
            }
            version.Time            = file.Time;
            version.Type            = file.Type;
            version.UniqueIdItem    = file.UniqueId;
            version.UniqueIdVersion = versionToAdd.UniqueId;
            version.Name            = file.Name;
            version.Description     = file.Description;
            version.Url             = file.Url;
            version.Extension       = file.Extension;
            version.ContentType     = file.ContentType;
            version.Repository      = file.Repository;
            return(version);
        }