
Hello,
how can I open more than one Snippetfolder in WPF Syntaxeditor?
regards
Frank
Hello,
how can I open more than one Snippetfolder in WPF Syntaxeditor?
regards
Frank
Hi Frank,
Can you provide some more detail on your question and the scenario you are encountering? Thanks!
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
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?
Hi,
yes, this is right.
regards
Frank
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.
Please log in to a validated account to post comments.