ScintillaNET.Lexing.loadStyleMap C# (CSharp) Method

loadStyleMap() private method

private loadStyleMap ( ) : void
return void
        private void loadStyleMap()
        {
            if (Scintilla.IsDesignMode)
                return;

            _styleNameMap.Clear();

            // These are global constants that always apply
            _styleNameMap.Add("BRACEBAD",Constants.STYLE_BRACEBAD);
            _styleNameMap.Add("BRACELIGHT",Constants.STYLE_BRACELIGHT);
            _styleNameMap.Add("CALLTIP",Constants.STYLE_CALLTIP);
            _styleNameMap.Add("CONTROLCHAR",Constants.STYLE_CONTROLCHAR);
            _styleNameMap.Add("DEFAULT",Constants.STYLE_DEFAULT);
            _styleNameMap.Add("LINENUMBER",Constants.STYLE_LINENUMBER);

            string lexname = this.Lexer.ToString().ToLower();

            using (Stream s = GetType().Assembly.GetManifestResourceStream("ScintillaNET.Configuration.Builtin.LexerStyleNames." + lexname + ".txt"))
            {
                if (s == null)
                    return;

                using (StreamReader sr = new StreamReader(s))
                {
                    while (!sr.EndOfStream)
                    {
                        string[] arr = sr.ReadLine().Split('=');
                        if (arr.Length != 2)
                            continue;

                        string key = arr[0].Trim();
                        int value = int.Parse(arr[1].Trim());

                        _styleNameMap.Remove(key);
                        _styleNameMap.Add(key, value);
                    }
                }
            }
        }