i have a basic DataTag class defined in this way:
public abstract class DataTag<TRaw, TVal>
{
public abstract TVal Value { get; }
public TRaw RawValue { get; set; }
public string Name { get; private set; }
public string Desc { get; private set; }
}
where TRaw is raw data taken from a device, while TVal is the "formatted" value.
So i may have 2 tags from same device:
DataTag t1 = DataTag.Create<ushort,int>();
DataTag t2 = DataTag.Create<ushort[],float()>;
Now i have a class which should contain a list of generic tags
private IEnumerable<DataTag<?,?> _tags();
Of course C# will not accept different kind of generic in the same list, but this is what i would like to achieve. Any tip for that?