FromString() public static method

Creates a string result where the display text and value are the same object.
public static FromString ( string stringValue ) : ContextAssistSearchResult
stringValue string the result string
return ContextAssistSearchResult
示例#1
0
 public override bool CanAssist(RichCommandLineContext context)
 {
     if (context.CurrentTokenIndex == 0 && Definition.Actions.Count > 0)
     {
         Options.Clear();
         Options.AddRange(Definition.Actions.Select(a => ContextAssistSearchResult.FromString(a.DefaultAlias)));
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#2
0
 public override bool CanAssist(RichCommandLineContext context)
 {
     if (TargetArgument != null && TargetArgument.ArgumentType.IsEnum)
     {
         Options.Clear();
         Options.AddRange(Enum.GetNames(TargetArgument.ArgumentType).Select(name => ContextAssistSearchResult.FromString(name)));
         return(true);
     }
     else
     {
         return(false);
     }
 }