Пример #1
0
 /// <summary>
 /// Performs a match if this condition is met
 /// </summary>
 /// <param name="arg">command argument value</param>
 /// <returns></returns>
 public bool Match(CommandArgValue arg)
 {
     if (Matched)
     {
         return(true);
     }
     if (arg != null && Condition(arg))
     {
         Arg = arg;
         return(true);
     }
     return(false);
 }
Пример #2
0
 public static string GetValue(this CommandArgValue arg)
 {
     return((!(arg is CommandArgKeypair argKeyPair)) ?
            null :
            ((argKeyPair.ValueType == CommandArgItemType.String) ? argKeyPair.Value.UnwrapQuotes() : argKeyPair.Value));
 }
Пример #3
0
 public static string GetKey(this CommandArgValue arg)
 {
     return((arg == null) ?
            null :
            ((arg.Type == CommandArgItemType.String) ? arg.Key.UnwrapQuotes() : arg.Key));
 }