mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
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:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user