webdav portal auth via ad
This commit is contained in:
parent
05d9fddb5d
commit
7dd090820b
56 changed files with 927 additions and 281 deletions
|
@ -0,0 +1,60 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WebsitePanel.WebDav.Core.Config.WebConfigSections;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.Config.Entities
|
||||
{
|
||||
public class FileIconsDictionary : AbstractConfigCollection, IReadOnlyDictionary<string, string>
|
||||
{
|
||||
private readonly IDictionary<string, string> _fileIcons;
|
||||
|
||||
public FileIconsDictionary()
|
||||
{
|
||||
DefaultPath = ConfigSection.FileIcons.DefaultPath;
|
||||
_fileIcons = ConfigSection.FileIcons.Cast<FileIconsElement>().ToDictionary(x => x.Extension, y => y.Path);
|
||||
}
|
||||
|
||||
public string DefaultPath { get; private set; }
|
||||
|
||||
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
|
||||
{
|
||||
return _fileIcons.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return _fileIcons.Count; }
|
||||
}
|
||||
|
||||
public bool ContainsKey(string extension)
|
||||
{
|
||||
return _fileIcons.ContainsKey(extension);
|
||||
}
|
||||
|
||||
public bool TryGetValue(string extension, out string path)
|
||||
{
|
||||
return _fileIcons.TryGetValue(extension, out path);
|
||||
}
|
||||
|
||||
public string this[string extension]
|
||||
{
|
||||
get { return ContainsKey(extension) ? _fileIcons[extension] : DefaultPath; }
|
||||
}
|
||||
|
||||
public IEnumerable<string> Keys
|
||||
{
|
||||
get { return _fileIcons.Keys; }
|
||||
}
|
||||
|
||||
public IEnumerable<string> Values
|
||||
{
|
||||
get { return _fileIcons.Values; }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue