mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-24 01:45:07 +00:00
25 lines
661 B
C#
25 lines
661 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Crestron.SimplSharp;
|
|
|
|
namespace PepperDash.Essentials.Core
|
|
{
|
|
/// <summary>
|
|
/// Basically a List , with an indexer to find feedbacks by key name
|
|
/// </summary>
|
|
public class FeedbackCollection<T> : List<T> where T : Feedback
|
|
{
|
|
/// <summary>
|
|
/// Case-insensitive port lookup linked to feedbacks' keys
|
|
/// </summary>
|
|
public T this[string key]
|
|
{
|
|
get
|
|
{
|
|
return this.FirstOrDefault(i => i.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
|
}
|
|
}
|
|
}
|
|
} |