SyntaxEditor 4.0 Code Snippet Enhancement Question

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hey everyone, we're working on enhancing code snippets so that you are able to optionally load only header information from the XML files. This will enable you to save on memory when using the code snippet features since none of the "snippet" part of a code snippet will be loaded, like the code.

Then later, when a snippet is activated, it will be fully loaded (in a separate instance) from whatever SourceFile is indicated.

Our question is, should the default be changed to use this enhanced memory-reducing feature or should we keep the default to always fully load code snippets like it does now in v3.1?

And please note that new object model features have been added to support using either way. Our question is simply for which way you think we should default.


Actipro Software Support

Comments (2)

Posted 18 years ago by Marianne
Avatar
As long as it doesn't break existing code I vote for the on-demand snippet loading. I don't think it will cause any performance issues and it should definitely save on memory especially if you have a lot of large snippets.

------------------------------- Marianne

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The only thing it would break is if after loading a CodeSnippet from a file or XmlDocument loading snippets in a CodeSnippetFolder from a path, you had code that was accessing the non-header properties of the loaded code snippets. But in that case you just use a new overload for the methods like the CodeSnippetFolder constructor, Refresh method, and CodeSnippet.LoadFromXml and you can have it behave the v3.1 way. I would think most people wouldn't have any sort of post-load code and would want to save on memory by default.

One other note is that if you pass a header-only code snippet to be activated, it will internally make a new CodeSnippet instance that is used for IntelliPrompt. It will also copy the ImageIndex and Tag properties to the new instance. But any other custom ones you make won't be copied in case you pass a class that inherits CodeSnippet with custom properties. However to work around that you could just ensure the custom code snippet is fully loaded before calling Activate and that solves that problem.


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.