ARCed.Scintilla.Configuration.Configuration.ReadMargins C# (CSharp) Метод

ReadMargins() приватный Метод

private ReadMargins ( XmlReader reader ) : void
reader XmlReader
Результат void
        private void ReadMargins(XmlReader reader)
        {
            if (reader.HasAttributes)
            {
                while (reader.MoveToNextAttribute())
                {
                    string attrName = reader.Name.ToLower();
                    switch (attrName)
                    {
                        case "foldmargincolor":
                            this._margin_List.FoldMarginColor = this.getColor(reader.Value);
                            break;
                        case "foldmarginhighlightcolor":
                            this._margin_List.FoldMarginHighlightColor = this.getColor(reader.Value);
                            break;
                        case "left":
                            this._margin_List.Left = this.getInt(reader.Value);
                            break;
                        case "right":
                            this._margin_List.Right = this.getInt(reader.Value);
                            break;
                        case "inherit":
                            this._margin_List.Inherit = this.getBool(reader.Value);
                            break;
                    }
                }
                reader.MoveToElement();
            }

            if (!reader.IsEmptyElement)
            {
                while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name.Equals("margins", StringComparison.OrdinalIgnoreCase)))
                {
                    reader.Read();
                    if (reader.NodeType == XmlNodeType.Element && reader.Name.Equals("margin", StringComparison.OrdinalIgnoreCase))
                    {
                        if (reader.HasAttributes)
                        {
                            var mc = new MarginConfig();
                            while (reader.MoveToNextAttribute())
                            {
                                string attrName = reader.Name.ToLower();
                                switch (attrName)
                                {
                                    case "number":
                                        mc.Number = int.Parse(reader.Value);
                                        break;
                                    case "inherit":
                                        mc.Inherit = this.getBool(reader.Value);
                                        break;
                                    case "autotogglemarkernumber":
                                        mc.AutoToggleMarkerNumber = this.getInt(reader.Value);
                                        break;
                                    case "isclickable":
                                        mc.IsClickable = this.getBool(reader.Value);
                                        break;
                                    case "isfoldmargin":
                                        mc.IsFoldMargin = this.getBool(reader.Value);
                                        break;
                                    case "ismarkermargin":
                                        mc.IsMarkerMargin = this.getBool(reader.Value);
                                        break;
                                    case "type":
                                        mc.Type = (MarginType)Enum.Parse(typeof(MarginType), reader.Value, true);
                                        break;
                                    case "width":
                                        mc.Width = this.getInt(reader.Value);
                                        break;
                                }
                            }
                            this._margin_List.Add(mc);
                            reader.MoveToElement();
                        }
                    }
                }
            }

            reader.Read();
        }