skyscraper8/skyscraper8/Dvb/ExtensionDescriptorAttribute.cs
feyris-tan ef86554f9a Import
2025-05-12 22:09:16 +02:00

33 lines
869 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper5.Dvb
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
sealed class ExtensionDescriptorAttribute : Attribute
{
public byte DescriptorId { get; }
public string[] CompatibleTables { get; }
public ExtensionDescriptorAttribute(byte descriptorId, params string[] compatibleTables)
{
DescriptorId = descriptorId;
CompatibleTables = compatibleTables;
}
public bool Matches(string table)
{
foreach (string compatibleTable in CompatibleTables)
{
if (compatibleTable == table)
return true;
}
return false;
}
}
}