Fixes: U4-4055 List View document types still display children in content tree

This commit is contained in:
Shannon
2014-01-17 13:00:11 +11:00
parent 79567d4e8f
commit ae05bfd350
7 changed files with 50 additions and 21 deletions

View File

@@ -231,7 +231,7 @@ namespace Umbraco.Core
/// <returns>The contains key ignore case.</returns>
public static bool ContainsKeyIgnoreCase<TValue>(this IDictionary<string, TValue> dictionary, string key)
{
return dictionary.Keys.Any(i => i.Equals(key, StringComparison.CurrentCultureIgnoreCase));
return dictionary.Keys.InvariantContains(key);
}
/// <summary>
@@ -257,9 +257,9 @@ namespace Umbraco.Core
/// <param name="key">The key.</param>
/// <typeparam name="TValue">The type</typeparam>
/// <returns>The entry</returns>
public static TValue GetEntryIgnoreCase<TValue>(this IDictionary<string, TValue> dictionary, string key)
public static TValue GetValueIgnoreCase<TValue>(this IDictionary<string, TValue> dictionary, string key)
{
return dictionary.GetEntryIgnoreCase(key, default(TValue));
return dictionary.GetValueIgnoreCase(key, default(TValue));
}
/// <summary>The get entry ignore case.</summary>
@@ -268,11 +268,11 @@ namespace Umbraco.Core
/// <param name="defaultValue">The default value.</param>
/// <typeparam name="TValue">The type</typeparam>
/// <returns>The entry</returns>
public static TValue GetEntryIgnoreCase<TValue>(this IDictionary<string, TValue> dictionary, string key, TValue defaultValue)
public static TValue GetValueIgnoreCase<TValue>(this IDictionary<string, TValue> dictionary, string key, TValue defaultValue)
{
key = dictionary.Keys.Where(i => i.Equals(key, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault();
key = dictionary.Keys.FirstOrDefault(i => i.InvariantEquals(key));
return !key.IsNullOrWhiteSpace()
return key.IsNullOrWhiteSpace() == false
? dictionary[key]
: defaultValue;
}