private void ReadSnippets(XmlReader reader)
{
if (reader.HasAttributes)
{
while (reader.MoveToNextAttribute())
{
string attrName = reader.Name.ToLower();
switch (attrName)
{
case "activesnippetcolor":
this._snippetsConfigList.ActiveSnippetColor = this.getColor(reader.Value);
break;
case "activesnippetindicator":
this._snippetsConfigList.ActiveSnippetIndicator = this.getInt(reader.Value);
break;
case "inactivesnippetcolor":
this._snippetsConfigList.InactiveSnippetColor = this.getColor(reader.Value);
break;
case "inactivesnippetindicator":
this._snippetsConfigList.InactiveSnippetIndicator = this.getInt(reader.Value);
break;
case "activesnippetindicatorstyle":
this._snippetsConfigList.ActiveSnippetIndicatorStyle = (IndicatorStyle)Enum.Parse(typeof(IndicatorStyle), reader.Value, true);
break;
case "inactivesnippetindicatorstyle":
this._snippetsConfigList.InactiveSnippetIndicatorStyle = (IndicatorStyle)Enum.Parse(typeof(IndicatorStyle), reader.Value, true);
break;
case "defaultdelimeter":
this._snippetsConfigList.DefaultDelimeter = this.getChar(reader.Value);
break;
case "isenabled":
this._snippetsConfigList.IsEnabled = this.getBool(reader.Value);
break;
case "isonekeyselectionembedenabled":
this._snippetsConfigList.IsOneKeySelectionEmbedEnabled = this.getBool(reader.Value);
break;
}
}
reader.MoveToElement();
}
if (!reader.IsEmptyElement)
{
while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name.Equals("snippets", StringComparison.OrdinalIgnoreCase)))
{
reader.Read();
if (reader.NodeType == XmlNodeType.Element && reader.Name.Equals("snippet", StringComparison.OrdinalIgnoreCase))
{
if (reader.HasAttributes)
{
var sc = new SnippetsConfig();
if (reader.HasAttributes)
{
while (reader.MoveToNextAttribute())
{
string attrName = reader.Name.ToLower();
switch (attrName)
{
case "shortcut":
sc.Shortcut = reader.Value;
break;
case "delimeter":
sc.Delimeter = this.getChar(reader.Value);
break;
case "issurroundswith":
sc.IsSurroundsWith = this.getBool(reader.Value);
break;
}
}
}
reader.MoveToElement();
sc.Code = reader.ReadString();
this._snippetsConfigList.Add(sc);
}
}
}
}
reader.Read();
}