initial files

This commit is contained in:
2020-09-04 21:19:24 -04:00
parent 7943589101
commit 2aa9ce3eb7
28 changed files with 3246 additions and 0 deletions

View File

@ -0,0 +1,21 @@
using System;
namespace BinaryDad.Extensions
{
/// <summary>
/// Binds data from command line flags to attached property. In the example, [<see cref="CommandFlagAttribute"/>("context")] public string Context { get; set; }, a command of "command.exe -context Production" will set Context property equal to "Production".
/// </summary>
public class CommandFlagAttribute : Attribute
{
public string Flag { get; }
/// <summary>
/// The name of the flag, without the preceding dash (-)
/// </summary>
/// <param name="flag"></param>
public CommandFlagAttribute(string flag)
{
Flag = flag;
}
}
}

View File

@ -0,0 +1,10 @@
using System;
namespace BinaryDad.Extensions
{
/// <summary>
/// Allows for a complex property to be populated via ToType().
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class DataRowPopulateAttribute : Attribute { }
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace BinaryDad.Extensions
{
/// <summary>
/// Allows for additional metadata to be applied to Enum values
/// </summary>
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class EnumAliasAttribute : Attribute
{
public IEnumerable<string> EnumAliasNames { get; private set; }
public EnumAliasAttribute(params string[] ids)
{
EnumAliasNames = ids;
}
}
}