A class that represents a search result that can be selected by the ContextAssistSearch context assist provider.
Example #1
0
 void Items_Removed(ContextAssistSearchResult obj)
 {
     if(Items.Count == 0)
     {
         //
     }
     else if (SelectedIndex >= Items.Count)
     {
         SelectedIndex = Items.Count - 1;
     }
 }
Example #2
0
 void Items_Removed(ContextAssistSearchResult obj)
 {
     if (Items.Count == 0)
     {
         //
     }
     else if (SelectedIndex >= Items.Count)
     {
         SelectedIndex = Items.Count - 1;
     }
 }
Example #3
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);
     }
 }
Example #4
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);
     }
 }