public static ScintillaNet.Configuration.Configuration Config(string filePath)
        {
            ScintillaNet.Configuration.Configuration config = new ScintillaNet.Configuration.Configuration("custom");

            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(filePath);
            XmlElement xDocEle = xDoc.DocumentElement;

            config.Styles          = GetStyles(xDocEle);
            config.Lexing_Keywords = GetKeywords(xDocEle);
            return(config);
        }
 public void Configure(Configuration config)
 {
     Configure(new List<Configuration>(new Configuration[] { config }));
 }
        public void Configure()
        {
            if (Scintilla.IsDesignMode || Scintilla.IsInitializing)
                return;

            Configuration builtInDefault = null,
                builtInLang = null,
                customDefault = null,
                customLang = null,
                userDefault = null,
                userLang = null;

            if (_isBuiltInEnabled)
            {
                using(Stream s = GetType().Assembly.GetManifestResourceStream("ScintillaNet.Configuration.Builtin.default.xml"))
                    builtInDefault = new Configuration(s, "default", _useXmlReader);
                if (!string.IsNullOrEmpty(_language))
                    using (Stream s = GetType().Assembly.GetManifestResourceStream("ScintillaNet.Configuration.Builtin." + _language + ".xml"))
                        if (s != null)
                            builtInLang = new Configuration(s, _language, _useXmlReader);
            }

            if (_isUserEnabled)
            {
                string defPath = Path.Combine(userFolder, "default.xml");
                if (File.Exists(defPath))
                    userDefault = new Configuration(defPath, "default", _useXmlReader);

                if (!string.IsNullOrEmpty(_language))
                {
                    string langPath = Path.Combine(userFolder, _language + ".xml");
                    if (File.Exists(langPath))
                        userLang = new Configuration(langPath, _language, _useXmlReader);
                }
            }

            if (!string.IsNullOrEmpty(_customLocation))
            {
                string customDefaultPath = getCustomConfigPath("default");
                string customLanguagePath = getCustomConfigPath(_language);

                if (!string.IsNullOrEmpty(customDefaultPath))
                    customDefault = new Configuration(customDefaultPath, "default", _useXmlReader);

                if (!string.IsNullOrEmpty(customLanguagePath))
                    customLang = new Configuration(customLanguagePath, _language, _useXmlReader);
                else
                    throw new FileNotFoundException("Could not find the custom configuration file.", _customLocation);
            }

            List<Configuration> configList = new List<Configuration>();
            if (_loadOrder == ConfigurationLoadOrder.BuiltInCustomUser)
            {
                if (builtInDefault != null && builtInDefault.HasData)
                    configList.Add(builtInDefault);

                if (builtInLang != null && builtInLang.HasData)
                    configList.Add(builtInLang);

                if (customDefault != null && customDefault.HasData)
                    configList.Add(customDefault);

                if (customLang != null && customLang.HasData)
                    configList.Add(customLang);

                if (userDefault != null && userDefault.HasData)
                    configList.Add(userDefault);

                if (userLang != null && userLang.HasData)
                    configList.Add(userLang);
            }
            else if (_loadOrder == ConfigurationLoadOrder.BuiltInUserCustom)
            {
                if (builtInDefault != null && builtInDefault.HasData)
                    configList.Add(builtInDefault);

                if (builtInLang != null && builtInLang.HasData)
                    configList.Add(builtInLang);

                if (userDefault != null && userDefault.HasData)
                    configList.Add(userDefault);

                if (userLang != null && userLang.HasData)
                    configList.Add(userLang);

                if (customDefault != null && customDefault.HasData)
                    configList.Add(customDefault);

                if (customLang != null && customLang.HasData)
                    configList.Add(customLang);
            }
            else if (_loadOrder == ConfigurationLoadOrder.CustomBuiltInUser)
            {
                if (customDefault != null && customDefault.HasData)
                    configList.Add(customDefault);

                if (customLang != null && customLang.HasData)
                    configList.Add(customLang);

                if (builtInDefault != null && builtInDefault.HasData)
                    configList.Add(builtInDefault);

                if (builtInLang != null && builtInLang.HasData)
                    configList.Add(builtInLang);

                if (userDefault != null && userDefault.HasData)
                    configList.Add(userDefault);

                if (userLang != null && userLang.HasData)
                    configList.Add(userLang);
            }
            else if (_loadOrder == ConfigurationLoadOrder.CustomUserBuiltIn)
            {
                if (customDefault != null && customDefault.HasData)
                    configList.Add(customDefault);

                if (customLang != null && customLang.HasData)
                    configList.Add(customLang);

                if (userDefault != null && userDefault.HasData)
                    configList.Add(userDefault);

                if (userLang != null && userLang.HasData)
                    configList.Add(userLang);

                if (builtInDefault != null && builtInDefault.HasData)
                    configList.Add(builtInDefault);

                if (builtInLang != null && builtInLang.HasData)
                    configList.Add(builtInLang);
            }
            else if (_loadOrder == ConfigurationLoadOrder.UserBuiltInCustom)
            {
                if (userDefault != null && userDefault.HasData)
                    configList.Add(userDefault);

                if (userLang != null && userLang.HasData)
                    configList.Add(userLang);

                if (builtInDefault != null && builtInDefault.HasData)
                    configList.Add(builtInDefault);

                if (builtInLang != null && builtInLang.HasData)
                    configList.Add(builtInLang);

                if (customDefault != null && customDefault.HasData)
                    configList.Add(customDefault);

                if (customLang != null && customLang.HasData)
                    configList.Add(customLang);

            }
            else if (_loadOrder == ConfigurationLoadOrder.UserCustomBuiltIn)
            {
                if (userDefault != null && userDefault.HasData)
                    configList.Add(userDefault);

                if (userLang != null && userLang.HasData)
                    configList.Add(userLang);

                if (customDefault != null && customDefault.HasData)
                    configList.Add(customDefault);

                if (customLang != null && customLang.HasData)
                    configList.Add(customLang);

                if (builtInDefault != null && builtInDefault.HasData)
                    configList.Add(builtInDefault);

                if (builtInLang != null && builtInLang.HasData)
                    configList.Add(builtInLang);
            }

            Configure(configList);
        }
        public static ScintillaNet.Configuration.Configuration Config(string filePath)
        {
            ScintillaNet.Configuration.Configuration config = new ScintillaNet.Configuration.Configuration("custom");

            XmlDocument xDoc = new XmlDocument();
            xDoc.Load(filePath);
            XmlElement xDocEle = xDoc.DocumentElement;

            config.Styles = GetStyles(xDocEle);
            config.Lexing_Keywords = GetKeywords(xDocEle);
            return config;
        }
 private void LoadPipeScintillaConfiguration()
 {
     this.pipeScintillaConfiguration = new ScintillaNet.Configuration.Configuration(this.LispPipeConfigPath, "lisp", true);
 }
 private void LoadScintillaConfiguration()
 {
     this.scintillaConfiguration = new ScintillaNet.Configuration.Configuration(this.LispConfigPath, "lisp", true);
 }