Web.config section fix

This commit is contained in:
vfedosevich 2014-12-30 04:04:27 -08:00
parent f5b41b5c85
commit 58b6b89ab0
10 changed files with 3 additions and 104 deletions

View file

@ -1,39 +0,0 @@
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using WebsitePanel.WebDavPortal.WebConfigSections;
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class ConnectionStringsCollection : AbstractConfigCollection
{
private readonly IEnumerable<AppConnectionStringsElement> _appConnectionStringsElements;
public ConnectionStringsCollection()
{
_appConnectionStringsElements = ConfigSection.ConnectionStrings.Cast<AppConnectionStringsElement>();
}
public string WebDavServer
{
get
{
AppConnectionStringsElement connectionStr =
_appConnectionStringsElements.FirstOrDefault(
x => x.Key == AppConnectionStringsElement.WebdavConnectionStringKey);
return connectionStr != null ? connectionStr.ConnectionString : null;
}
}
public string LdapServer
{
get
{
AppConnectionStringsElement connectionStr =
_appConnectionStringsElements.FirstOrDefault(
x => x.Key == AppConnectionStringsElement.LdapConnectionStringKey);
return connectionStr != null ? connectionStr.ConnectionString : null;
}
}
}
}

View file

@ -8,7 +8,6 @@ namespace WebsitePanel.WebDavPortal.Config
string ApplicationName { get; }
ElementsRendering ElementsRendering { get; }
WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; }
ConnectionStringsCollection ConnectionStrings { get; }
SessionKeysCollection SessionKeys { get; }
FileIconsDictionary FileIcons { get; }
HttpErrorsCollection HttpErrors { get; }

View file

@ -14,7 +14,6 @@ namespace WebsitePanel.WebDavPortal.Config
_configSection = ((WebDavExplorerConfigurationSettingsSection) ConfigurationManager.GetSection(WebDavExplorerConfigurationSettingsSection.SectionName));
WebsitePanelConstantUserParameters = new WebsitePanelConstantUserParameters();
ElementsRendering = new ElementsRendering();
ConnectionStrings = new ConnectionStringsCollection();
SessionKeys = new SessionKeysCollection();
FileIcons = new FileIconsDictionary();
HttpErrors = new HttpErrorsCollection();
@ -38,7 +37,6 @@ namespace WebsitePanel.WebDavPortal.Config
public ElementsRendering ElementsRendering { get; private set; }
public WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; private set; }
public ConnectionStringsCollection ConnectionStrings { get; private set; }
public SessionKeysCollection SessionKeys { get; private set; }
public FileIconsDictionary FileIcons { get; private set; }
public HttpErrorsCollection HttpErrors { get; private set; }