Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandLineArgumentAttribute"/> class.
 /// </summary>
 /// <param name="name">The command line key.</param>
 /// <param name="seperator">Sets the key/value seperator.</param>
 /// <param name="repetition">Sets the repitition type for the argument's key.</param>
 /// <param name="order">Sets the order for this argument</param>
 public CommandLineArgumentAttribute(string name, ArgumentSeperator seperator, KeyRepetition repetition, [CallerLineNumber] int order = 0)
 {
     Name       = name;
     Seperator  = seperator;
     Repetition = repetition;
     Order      = order;
 }
Esempio n. 2
0
 /// <summary>
 /// Gets the enum mebmber value of <see cref="ArgumentSeperator"/>.
 /// </summary>
 /// <param name="seperator">The seperator.</param>
 /// <returns></returns>
 internal static string ToArgumentSeperatorString(this ArgumentSeperator seperator)
 {
     return(seperator.GetType()
            .GetRuntimeField(seperator.ToString())
            .GetCustomAttributes(typeof(EnumMemberAttribute), true)
            .Select(a => ((EnumMemberAttribute)a).Value).FirstOrDefault());
 }