Load xml syntax dinamically

Topics: User Forum
Jan 27, 2010 at 12:42 PM

Hi,

is it possible to load dinamically the xml syntax without the customLocation?

i.e.:

scintilla.ConfigurationManager.Language = "<?xml version="1.0" encoding="utf-8" ?>
<ScintillaNET>
  <Language Name="html">
    <AutoComplete FillUpCharacters=".([&quot;'" SingleLineAccept="True" IsCaseSensitive="False">
      <List>
        .......
      </List>
    </AutoComplete>

...."

 

Thanks!!

Coordinator
Jan 28, 2010 at 10:47 PM

I haven't tested this but I think the easiest way to get what you're looking for is to:

  1. Create an XmlDocument from your in-memory string:
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(myConfigString);
    
  2. Pass the XmlDocument to the appropriate overload of the Configuration constructor:
    Configuration config = new Configuration(doc, "default");
    
  3. Pass the Configuration object to the ConfigurationManager.Configure method:
    scintilla.ConfigurationManager.Configure(config);
    

Something like that. :)

Thanks,
Jacob

 

Jan 29, 2010 at 9:20 AM

Thanks Jacob,  ...going to test it...