24 lines
509 B
C#
24 lines
509 B
C#
using System.Collections.ObjectModel;
|
|
|
|
namespace Manager.YouTube;
|
|
|
|
public class YouTubeClientCollection : KeyedCollection<string, YouTubeClient>
|
|
{
|
|
protected override string GetKeyForItem(YouTubeClient item)
|
|
{
|
|
return item.Id;
|
|
}
|
|
|
|
public new void Add(YouTubeClient client)
|
|
{
|
|
if (Items.Contains(client))
|
|
{
|
|
var index = Items.IndexOf(client);
|
|
Items[index] = client;
|
|
}
|
|
else
|
|
{
|
|
Items.Add(client);
|
|
}
|
|
}
|
|
} |