Class SuggestionStack
Managed stack of suggestion sets updated from a user prompt. Each suggestion set represents a layer of suggestions, allowing for nested suggestions.
Namespace: QFSW.QC
Assembly: QFSW.QC.dll
Syntax
public class SuggestionStack
Constructors
SuggestionStack()
Creates a SuggestionStack with a default QuantumSuggestor
Declaration
public SuggestionStack()
SuggestionStack(QuantumSuggestor)
Creates a SuggestionStack with a user provided QuantumSuggestor
Declaration
public SuggestionStack(QuantumSuggestor suggestor)
Parameters
Type | Name | Description |
---|---|---|
QuantumSuggestor | suggestor | The QuantumSuggestor to use when creating suggestions for the stack. |
Properties
TopmostSuggestion
The selected suggestion, if any, in the topmost suggestion set.
Declaration
public IQcSuggestion TopmostSuggestion { get; }
Property Value
Type | Description |
---|---|
IQcSuggestion |
TopmostSuggestionSet
The topmost valid suggestion set in the stack.
Declaration
public SuggestionSet TopmostSuggestionSet { get; }
Property Value
Type | Description |
---|---|
SuggestionSet |
Methods
Clear()
Clears the stack of all suggestions.
Declaration
public void Clear()
GetCompletion()
Gets the current completion value of the stack.
Declaration
public string GetCompletion()
Returns
Type | Description |
---|---|
String | The combined completion value of the stack. |
GetCompletionTail()
Gets the current completion tail of the stack.
Declaration
public string GetCompletionTail()
Returns
Type | Description |
---|---|
String | The combined completion tail of the stack. |
SetSuggestionIndex(Int32)
Attempts to set the selected suggestion in the topmost set.
Declaration
public bool SetSuggestionIndex(int suggestionIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | suggestionIndex | The index of the suggestion in the topmost set to select. |
Returns
Type | Description |
---|---|
Boolean | If the suggestion could be selected. |
UpdateStack(String, SuggestorOptions)
Updates the stack to the new prompt.
Declaration
public void UpdateStack(string prompt, SuggestorOptions options)
Parameters
Type | Name | Description |
---|---|---|
String | prompt | The prompt to update the stack with. |
SuggestorOptions | options | Options to provide to the suggestor. |
Events
OnSuggestionSetCreated
Callback invoked when a new suggestion set is created.
Declaration
public event Action<SuggestionSet> OnSuggestionSetCreated
Event Type
Type | Description |
---|---|
Action<SuggestionSet> |