Example #1
0
 public liteRepositorySettings()
 {
     Type          = SettingsType.Istance;
     Customization = CustomizationLevel.None;
     DiskSpace     = new DiskSettings();
     Views         = new List <liteViewSettings>();
     DefaultView   = PresetType.None;
     ItemTypes     = new List <liteItemTypeSettings>();
 }
Example #2
0
        public void Initialize(DiskSettings settings, Boolean overrideQuota, long usedSize = 0)
        {
            AllowOverrideQuota = overrideQuota;
            UsedSize           = usedSize;
            _Overflow          = settings.RepositoryOverflow;
            _AvailableSize     = settings.AdditionalSpace + settings.AvailableSpace;
            _MaxAvailableSize  = settings.MaxSpace;
            if (_MaxAvailableSize > DiskSize && DiskSize != -1)
            {
                _MaxAvailableSize = DiskSize;
            }

            _IsRepository = true;
            switch (settings.RepositoryOverflow)
            {
            case OverflowAction.Allow:
            case OverflowAction.AllowWithWarning:
                break;

            default:
                if (!overrideQuota)
                {
                    _MaxAvailableSize = _AvailableSize;
                }
                break;
            }
            _MaxUploadFileSize = settings.MaxUploadFileSize;
            _UploadOverflow    = settings.UploadOverflow;
            switch (settings.UploadOverflow)
            {
            case OverflowAction.Allow:
            case OverflowAction.AllowWithWarning:
                break;

            default:
                if (_MaxUploadFileSize > AvailableSize)
                {
                    _MaxUploadFileSize = AvailableSize;
                }
                break;
            }
            if (_MaxUploadFileSize > MaxAvailableSize)
            {
                _MaxUploadFileSize = MaxAvailableSize;
            }
        }