Files
Umbraco-CMS/src/Umbraco.Examine/StaticFieldCollection.cs
2017-07-27 12:01:38 +02:00

29 lines
775 B
C#

using System.Collections.ObjectModel;
namespace Umbraco.Examine
{
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)
{
if (Dictionary == null)
{
field = null;
return false;
}
return Dictionary.TryGetValue(key, out field);
}
}
}