So we can create ViewStreams that depend on other services, config, etc. Previously, the PrimitiveManager relied purely on static construction of types through reflection.
27 lines
823 B
C#
27 lines
823 B
C#
#nullable enable
|
|
namespace Bts.DataStreamCore;
|
|
|
|
using System;
|
|
|
|
[AttributeUsage(AttributeTargets.Property)]
|
|
public class StreamArgumentAttribute : Attribute {
|
|
public StreamArgumentAttribute(params string[] names) {
|
|
Names = names;
|
|
RegexNames = Array.Empty<string>();
|
|
}
|
|
|
|
public StreamArgumentAttribute(WellKnownStreamArgumentType wellKnownType, params string[] names) {
|
|
WellKnownType = wellKnownType;
|
|
Names = names;
|
|
RegexNames = Array.Empty<string>();
|
|
}
|
|
|
|
public string[] Names { get; }
|
|
public string[] RegexNames { get; set; }
|
|
public int Position { get; set; } = -1;
|
|
public WellKnownStreamArgumentType WellKnownType { get; }
|
|
public bool IsRequired { get; set; }
|
|
public bool AllowCommaSeparatedAliases { get; set; } = true;
|
|
public Type? ParserType { get; set; }
|
|
}
|