Re-factored IIS 7 provider to improve GetSite() operation performance.

This commit is contained in:
feodor_fitsner 2011-12-12 15:04:33 -08:00
parent 58b073a6aa
commit eb64f13221
21 changed files with 1058 additions and 1058 deletions

View file

@ -87,45 +87,22 @@ namespace WebsitePanel.Providers.Web.Handlers
}
}
public void SetHandlersAccessPolicy(string fqPath, HandlerAccessPolicy policy)
public void SetHandlersAccessPolicy(ServerManager srvman, string fqPath, HandlerAccessPolicy policy)
{
var config = srvman.GetWebConfiguration(fqPath);
//
using (var srvman = GetServerManager())
{
var config = srvman.GetWebConfiguration(fqPath);
//
HandlersSection section = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
//
section.AccessPolicy = policy;
//
srvman.CommitChanges();
}
HandlersSection section = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
//
section.AccessPolicy = policy;
}
public HandlerAccessPolicy GetHandlersAccessPolicy(string fqPath)
public HandlerAccessPolicy GetHandlersAccessPolicy(ServerManager srvman, string fqPath)
{
var config = srvman.GetWebConfiguration(fqPath);
//
using (var srvman = GetServerManager())
{
var config = srvman.GetWebConfiguration(fqPath);
//
HandlersSection section = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
//
return section.AccessPolicy;
}
}
internal ConfigurationElementCollection GetHandlers(WebVirtualDirectory virtualDir)
{
//
using (var srvman = GetServerManager())
{
var config = srvman.GetWebConfiguration(virtualDir.FullQualifiedPath);
//
var section = config.GetSection(Constants.HandlersSection);
//
return section.GetCollection();
}
HandlersSection section = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
//
return section.AccessPolicy;
}
/// <summary>