Opens more than one Codesnippetfolder

SyntaxEditor for WPF Forum

Posted 4 years ago by Frank Link - CEO, FLK Consulting UG
Version: 16.1.0631
Avatar

Hello,

how can I open more than one Snippetfolder in WPF Syntaxeditor?

 

regards

Frank

Comments (5)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Frank,

Can you provide some more detail on your question and the scenario you are encountering?  Thanks!


Actipro Software Support

Posted 4 years ago by Frank Link - CEO, FLK Consulting UG
Avatar

Hi,

yes I can. I have two root folders with several subfolders. One is the default folder for Application snippets and the other folder is for User Snippets.

With the SyntaxEditor for WinForms I can read the root folders and give them separatly a name e.g "Default" or "User".

In SyntaxEdit for WPF I read the folder structure with CodeSnippetFolder.LoadFrom(paths, "") and combine them with

var rootFolder = CodeSnippetFolder.LoadFrom(publicFolder, "");
if (rootFolder == null) return;
var userFolder = CodeSnippetFolder.LoadFrom(userFolder, "");
if (userFolder != null)
{
	rootFolder.Folders.Add(userFolder);
}
var snippetProvider = new CodeSnippetProvider() { RootFolder = rootFolder };
Editor.Document.Language.RegisterService(snippetProvider);
new DisplayItemClassificationTypeProvider().RegisterAll();

 But i can't give the root folder a name to get a structure e.g.:

insert Snippet: Default->BEE->...
		User->BEE->... 

where BEEML is one of the subfolder.

regards

Frank

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Frank,

If I understand correctly, you want to load two root folders.  One will be some arbitrary path and you wish for its root folder Name to be "Default".  The other is some other arbitrary path and you wish for its root folder Name to be "User".  The problem you are encountering is that you can't rename the two root folders since the ICodeSnippetFolder.Name property is read-only.  Is that right?


Actipro Software Support

Posted 4 years ago by Frank Link - CEO, FLK Consulting UG
Avatar

Hi,

yes, this is right.

regards

Frank

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Frank,

While the ICodeSnippetFolder's Name property is read-only, the CodeSnippetFolder implementation class' Name property is get/set.  If you cast to that, you can change it.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.