
Hi, All.
I unbound the default command for IntelliPrompt like this:Then I bound my custom one(according to samples).
After that the window of IntelliPrompt contains two lines as expected. But the images for
(int)IconResource.PublicMethod and IconResource.Operator do not display.
Why may this occured?
Thanks in advance.
I unbound the default command for IntelliPrompt like this:
for (int index = editor.CommandLinks.Count - 1; index >= 0; index--)
{
CommandLink commandLink = editor.CommandLinks[index];
if ((commandLink.KeyBinding.Modifiers == ActiproSoftware.WinUICore.Input.ModifierKeys.Control) && (commandLink.KeyBinding.Key == Keys.Space))
{
editor.CommandLinks.RemoveAt(index);
break;
}
}
// Bind
editor.CommandLinks.Add(new CommandLink(new CustomIntelliPromptCommand(), new KeyBinding(ActiproSoftware.WinUICore.Input.ModifierKeys.Control, Keys.Space)));
editor.Focus();
public class CustomIntelliPromptCommand : EditCommand
{
/// <summary>
/// Executes the edit command.
/// </summary>
/// <param name="context">An <see cref="EditCommandContext"/> that holds context-related information.</param>
public override void Execute(EditCommandContext context)
{
IntelliPromptMemberListItem item1 =
new IntelliPromptMemberListItem("Test1", (int)IconResource.PublicMethod, "public static double Test1(object data)");
IntelliPromptMemberListItem item2 =
new IntelliPromptMemberListItem("+", (int)IconResource.Operator, "Operator +");
context.SyntaxEditor.IntelliPrompt.MemberList.Clear();
context.SyntaxEditor.IntelliPrompt.MemberList.Add(item1);
context.SyntaxEditor.IntelliPrompt.MemberList.Add(item2);
context.SyntaxEditor.IntelliPrompt.MemberList.Show();
}
}
(int)IconResource.PublicMethod and IconResource.Operator do not display.
Why may this occured?
Thanks in advance.