ResourceManager: Making resource types and names not case-sensitive (important when using Include() due to slight variations).

--HG--
branch : dev
This commit is contained in:
Dave Reed
2010-09-30 18:24:46 -07:00
parent 974bc5c894
commit aa78fbe9f9
2 changed files with 4 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ namespace Orchard.UI.Resources {
private readonly Dictionary<Tuple<String, String>, RequireSettings> _required = new Dictionary<Tuple<String, String>, RequireSettings>();
private readonly List<LinkEntry> _links = new List<LinkEntry>();
private readonly Dictionary<string, MetaEntry> _metas = new Dictionary<string, MetaEntry>();
private readonly Dictionary<string, IList<ResourceRequiredContext>> _builtResources = new Dictionary<string, IList<ResourceRequiredContext>>();
private readonly Dictionary<string, IList<ResourceRequiredContext>> _builtResources = new Dictionary<string, IList<ResourceRequiredContext>>(StringComparer.OrdinalIgnoreCase);
private readonly IEnumerable<Meta<IResourceManifestProvider, IFeatureMetadata>> _providers;
private ResourceManifest _dynamicManifest;
private List<String> _headScripts;

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Web;
using Orchard.Environment.Extensions.Models;
@@ -5,7 +6,7 @@ using Orchard.Environment.Extensions.Models;
namespace Orchard.UI.Resources {
public class ResourceManifest : IResourceManifest {
private string _basePath;
private readonly IDictionary<string, IDictionary<string, ResourceDefinition>> _resources = new Dictionary<string, IDictionary<string, ResourceDefinition>>();
private readonly IDictionary<string, IDictionary<string, ResourceDefinition>> _resources = new Dictionary<string, IDictionary<string, ResourceDefinition>>(StringComparer.OrdinalIgnoreCase);
public virtual Feature Feature { get; set; }
@@ -33,7 +34,7 @@ namespace Orchard.UI.Resources {
public virtual IDictionary<string, ResourceDefinition> GetResources(string resourceType) {
IDictionary<string, ResourceDefinition> resources;
if (!_resources.TryGetValue(resourceType, out resources)) {
_resources[resourceType] = resources = new Dictionary<string, ResourceDefinition>();
_resources[resourceType] = resources = new Dictionary<string, ResourceDefinition>(StringComparer.OrdinalIgnoreCase);
}
return resources;
}