Auto-loading dynamic child languages from a stream

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Marianne
Avatar
To keep things simple, I have recently changed the location of the dynamic language files so that they are now stored as embedded resources inside the main application assembly itself. When I need to load a language I pass the stream to the LoadFromXml method. The problem is that if a language is being loaded via stream and it needs to load one or more child languages it immediately throws a 'language not found' exception. How can I allow the child languages to be loaded as well and keep them all as embedded resources inside the main assembly? Thanks.

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

Comments (4)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marianne,

One thing you could do is save out the "merged" language to a language XML file, which stores all the merged languages in one XML file. Our SDI editor sample can do this when you use the save feature on the Languages menu. Then if you store the merged XML definition in your assembly, there will not be any file searching.

Another option is to save your language files to a temp folder and load from there. Then remove the temp folder after the language is loaded.


Actipro Software Support

Posted 13 years ago by Marianne
Avatar
Even after I save all the languages to a single xml file, I still get the error that it cannot find the child language file. It's almost as if it is ignoring the other languages in the xml file and still trying to load via file. Can you reproduce this behavior?

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

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It should work fine... if I save out an unencrypted merged XML definition, there are no XML file references in it any more for child languages. You can see that in the MainForm by changing EncryptionKey to 0 and using the Save to Encrypted XML option.

So are you saying that it isn't finding the external XML definitions or it isn't loading the code-behind DynamicSyntaxLanguage class?


Actipro Software Support

Posted 13 years ago by Marianne
Avatar
Nevermind...

I needed to change the StateTransition tag names from 'Filename' to 'Language'

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

The latest build of this product (v2020.1 build 0400) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.