init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class FileServiceConfiguration : ConfigurationSection, IFileServiceConfiguration
|
||||
{
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
public StorageElementCollection Storages => (StorageElementCollection)base[string.Empty];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public interface IFileServiceConfiguration
|
||||
{
|
||||
StorageElementCollection Storages { get; }
|
||||
}
|
||||
}
|
10
Kreta.Core/FileService/Configuration/Path.cs
Normal file
10
Kreta.Core/FileService/Configuration/Path.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class Path : ConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty(nameof(Value), IsRequired = true, IsKey = true)]
|
||||
public string Value => (string)this[nameof(Value)];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class PathElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
protected override string ElementName => nameof(Path);
|
||||
|
||||
protected override ConfigurationElement CreateNewElement() => new Path();
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element) => ((Path)element).Value;
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMap;
|
||||
}
|
||||
}
|
19
Kreta.Core/FileService/Configuration/Storage.cs
Normal file
19
Kreta.Core/FileService/Configuration/Storage.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class Storage : ConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty(nameof(Key), IsRequired = true, IsKey = true)]
|
||||
public string Key => (string)this[nameof(Key)];
|
||||
|
||||
[ConfigurationProperty(nameof(MaxFileSizeInBytes), IsRequired = true)]
|
||||
public int MaxFileSizeInBytes => (int)this[nameof(MaxFileSizeInBytes)];
|
||||
|
||||
[ConfigurationProperty(nameof(MinimumRequiredFreeSpaceInBytes), IsRequired = true)]
|
||||
public int MinimumRequiredFreeSpaceInBytes => (int)this[nameof(MinimumRequiredFreeSpaceInBytes)];
|
||||
|
||||
[ConfigurationProperty(nameof(Paths), IsDefaultCollection = false)]
|
||||
public PathElementCollection Paths => (PathElementCollection)base[nameof(Paths)];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System.Configuration;
|
||||
|
||||
namespace Kreta.Core.FileService.Configuration
|
||||
{
|
||||
public class StorageElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
protected override string ElementName => nameof(Storage);
|
||||
|
||||
protected override ConfigurationElement CreateNewElement() => new Storage();
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element) => ((Storage)element).Key;
|
||||
|
||||
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMap;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue