Images in In IntelliPrompt.MemberList do not display

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 16 years ago by BorodaAlex
Version: 4.0.0274
Avatar
Hi, All.
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();

Then I bound my custom one(according to samples).

 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();
            }
        }
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.

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The reflection ImageList isn't set by default. You need to do it yourself or call methods (like in our add-ons) that do load it.

You can do so like this:
context.SyntaxEditor.IntelliPrompt.MemberList.ImageList = SyntaxEditor.ReflectionImageList;


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.