ARCed.Scintilla.Lexing.loadStyleMap C# (CSharp) Method

loadStyleMap() private method

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

            this._styleNameMap.Clear();

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

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

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

                using (var 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());

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