2017-02-01 16:48:09 +11:00
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
|
|
|
|
|
|
namespace UmbracoExamine
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class StaticFieldCollection : KeyedCollection<string, StaticField>
|
|
|
|
|
|
{
|
|
|
|
|
|
protected override string GetKeyForItem(StaticField item)
|
|
|
|
|
|
{
|
|
|
|
|
|
return item.Name;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Implements TryGetValue using the underlying dictionary
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="key"></param>
|
|
|
|
|
|
/// <param name="field"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public bool TryGetValue(string key, out StaticField field)
|
|
|
|
|
|
{
|
2017-02-02 16:02:29 +11:00
|
|
|
|
if (Dictionary == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
field = null;
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2017-02-01 16:48:09 +11:00
|
|
|
|
return Dictionary.TryGetValue(key, out field);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|