internal void Load(IVsSettingsReader reader, string key)
        {
            string temp;

            reader.ReadSettingAttribute(key, "ExtendInwardsOnly", out temp);
            ExtendInwardsOnly = bool.Parse(temp);
            reader.ReadSettingAttribute(key, "VisibleAligned", out temp);
            VisibleAligned = bool.Parse(temp);
            reader.ReadSettingAttribute(key, "VisibleUnaligned", out temp);
            VisibleUnaligned = bool.Parse(temp);
            reader.ReadSettingAttribute(key, "VisibleAtTextEnd", out temp);
            VisibleAtTextEnd = bool.Parse(temp);
            reader.ReadSettingAttribute(key, "VisibleEmpty", out temp);
            VisibleEmpty = bool.Parse(temp);
            reader.ReadSettingAttribute(key, "VisibleEmptyAtEnd", out temp);
            VisibleEmptyAtEnd = bool.Parse(temp);
            reader.ReadSettingAttribute(key, "Disabled", out temp);
            Disabled = bool.Parse(temp);
        }
        public static IndentTheme Load(IVsSettingsReader reader, string themeKey)
        {
            var theme = new IndentTheme();

            theme.ContentType = (themeKey == DefaultThemeName) ? null : themeKey;
            theme.Behavior.Load(reader, themeKey);
            string caretHandler;

            reader.ReadSettingString("CaretHandler", out caretHandler);
            theme.CaretHandler = caretHandler ?? DefaultCaretHandler;

            string subkeyNames, settingNames;

            ErrorHandler.ThrowOnFailure(reader.ReadSettingString(themeKey, out subkeyNames));
            if (!string.IsNullOrEmpty(subkeyNames))
            {
                foreach (var subkeyName in subkeyNames.Split(';'))
                {
                    if (string.IsNullOrEmpty(subkeyName))
                    {
                        continue;
                    }

                    int i = subkeyName.LastIndexOf('.');
                    if (i < 0)
                    {
                        continue;
                    }

                    var values = new Dictionary <string, string>();
                    if (ErrorHandler.Failed(reader.ReadSettingAttribute(subkeyName, "Keys", out settingNames)) ||
                        string.IsNullOrEmpty(settingNames))
                    {
                        settingNames = "LineStyle;LineColor;HighlightStyle;HighlightColor;Visible";
                    }
                    foreach (var setting in settingNames.Split(';'))
                    {
                        if (string.IsNullOrEmpty(subkeyName))
                        {
                            continue;
                        }
                        string value;
                        ErrorHandler.ThrowOnFailure(reader.ReadSettingAttribute(subkeyName, setting, out value));
                        if (!string.IsNullOrEmpty(value))
                        {
                            values[setting] = value;
                        }
                    }

                    var format = LineFormat.FromInvariantStrings(theme, values);
                    format.FormatIndexName = subkeyName.Substring(i + 1);
                    if (format.FormatIndex.HasValue)
                    {
                        theme.LineFormats[format.FormatIndex.GetValueOrDefault()] = format;
                    }
                    else
                    {
                        Trace.TraceWarning("{0}.{1} is not a valid format index.", themeKey, subkeyName);
                    }
                }
            }

            return(theme);
        }