Exemplo n.º 1
0
 public String GetMaxSize(Int32 decimals = 2)
 {
     if (FreeSize > 0 || !Quota.HasAllowedSpace())
     {
         return(FolderSizeItem.FormatBytes(Quota.AvailableSize, decimals));
     }
     else
     {
         return(FolderSizeItem.FormatBytes(Quota.MaxAvailableSize, decimals));
     }
 }
Exemplo n.º 2
0
        public String GetPossibleOverSize(long size, Int32 decimals = 2)
        {
            long newSize = FullSize + size;

            if (FreeSize > 0 || !Quota.HasAllowedSpace())
            {
                return(FolderSizeItem.FormatBytes((Quota.AvailableSize >= newSize) ? 0 : newSize - Quota.AvailableSize, decimals));
            }
            else
            {
                return(FolderSizeItem.FormatBytes((Quota.MaxAvailableSize >= newSize) ? 0 : newSize - Quota.MaxAvailableSize, decimals));
            }
        }
 public dtoDisplayObjectRepositoryItem(liteModuleLink link, liteRepositoryItem item, liteRepositoryItemVersion version)
 {
     LinkedBy    = "";
     IdLinkedBy  = 0;
     Permissions = new ItemPermission();
     Link        = link;
     Item        = item;
     Version     = version;
     if (version != null)
     {
         Description     = version.Description;
         Name            = version.Name;
         DisplayName     = version.DisplayName;
         IdCreatedBy     = version.IdCreatedBy;
         CreatedOn       = version.CreatedOn;
         IdVersion       = version.Id;
         Type            = version.Type;
         IdItem          = item.Id;
         DisplayMode     = version.DisplayMode;
         Url             = version.Url;
         Extension       = version.Extension;
         AutoThumbnail   = version.AutoThumbnail;
         IdVersion       = version.Id;
         UniqueId        = item.UniqueId;
         UniqueIdVersion = version.UniqueIdVersion;
         IsDownlodable   = item.IsDownloadable;
     }
     else if (item != null)
     {
         Description     = item.Description;
         Name            = item.Name;
         DisplayName     = item.DisplayName;
         IdCreatedBy     = item.IdCreatedBy;
         CreatedOn       = item.CreatedOn;
         IdVersion       = 0;
         UniqueIdVersion = Guid.Empty;
         Type            = item.Type;
         IdItem          = item.Id;
         DisplayMode     = item.DisplayMode;
         Url             = item.Url;
         Extension       = item.Extension;
         AutoThumbnail   = item.AutoThumbnail;
         IsDownlodable   = item.IsDownloadable;
     }
     Availability = (Version != null ? Version.Availability : (Item != null ? Item.Availability : ItemAvailability.notavailable));
     Size         = FolderSizeItem.FormatBytes((Version != null ? Version.Size : (Item != null ? Item.Size :0)));
 }
Exemplo n.º 4
0
 public String GetSize(Int32 decimals = 2)
 {
     return(FolderSizeItem.FormatBytes(Size, decimals));
 }
Exemplo n.º 5
0
 public String GetFreeSpace(Int32 decimals = 2)
 {
     return(FolderSizeItem.FormatBytes(FreeSpace, decimals));
 }
Exemplo n.º 6
0
 public String GetFolderMaxUploadFileSize(Int32 decimals = 2)
 {
     return(FolderSizeItem.FormatBytes(MaxUploadFileSize, decimals));
 }
Exemplo n.º 7
0
 public String GetMaxAvailableSize(Int32 decimals = 2)
 {
     return(FolderSizeItem.FormatBytes(MaxAvailableSize, decimals));
 }
Exemplo n.º 8
0
 public String GetPercentageSize(Int32 decimals = 2)
 {
     return(FolderSizeItem.FormatBytes((long)0, decimals));
 }