protected override bool OnDeserializeUnrecognizedElement(String elementName, XmlReader reader) { bool handled = false; // Deal with the "group" element if (elementName == "group") { ProfileGroupSettingsCollection groupCollection; ProfileGroupSettings newGroupSettings; ProfileGroupSettings curGroupSettings = null; string name = reader.GetAttribute("name"); groupCollection = GroupSettings; if (name != null) { curGroupSettings = groupCollection[name]; } newGroupSettings = new ProfileGroupSettings(); newGroupSettings.InternalReset(curGroupSettings); newGroupSettings.InternalDeserialize(reader, false); groupCollection.AddOrReplace(newGroupSettings); handled = true; } else { if (elementName == "clear") { GroupSettings.Clear(); } // Let the base class deal with "add, remove, clear" handled = base.OnDeserializeUnrecognizedElement(elementName, reader); } return handled; }
protected override bool OnDeserializeUnrecognizedElement(String elementName, XmlReader reader) { bool handled = false; // Deal with the "group" element if (elementName == "group") { ProfileGroupSettingsCollection groupCollection; ProfileGroupSettings newGroupSettings; ProfileGroupSettings curGroupSettings = null; string name = reader.GetAttribute("name"); groupCollection = GroupSettings; if (name != null) { curGroupSettings = groupCollection[name]; } newGroupSettings = new ProfileGroupSettings(); newGroupSettings.InternalReset(curGroupSettings); newGroupSettings.InternalDeserialize(reader, false); groupCollection.AddOrReplace(newGroupSettings); handled = true; } else { if (elementName == "clear") { GroupSettings.Clear(); } // Let the base class deal with "add, remove, clear" handled = base.OnDeserializeUnrecognizedElement(elementName, reader); } return(handled); }
protected override bool OnDeserializeUnrecognizedElement(string elementName, XmlReader reader) { if (elementName == "group") { ProfileGroupSettings parentSettings = null; string attribute = reader.GetAttribute("name"); ProfileGroupSettingsCollection groupSettings = this.GroupSettings; if (attribute != null) { parentSettings = groupSettings[attribute]; } ProfileGroupSettings settings = new ProfileGroupSettings(); settings.InternalReset(parentSettings); settings.InternalDeserialize(reader, false); groupSettings.AddOrReplace(settings); return(true); } if (elementName == "clear") { this.GroupSettings.Clear(); } return(base.OnDeserializeUnrecognizedElement(elementName, reader)); }
protected override bool OnDeserializeUnrecognizedElement(string elementName, XmlReader reader) { if (elementName == "group") { ProfileGroupSettings parentSettings = null; string attribute = reader.GetAttribute("name"); ProfileGroupSettingsCollection groupSettings = this.GroupSettings; if (attribute != null) { parentSettings = groupSettings[attribute]; } ProfileGroupSettings settings = new ProfileGroupSettings(); settings.InternalReset(parentSettings); settings.InternalDeserialize(reader, false); groupSettings.AddOrReplace(settings); return true; } if (elementName == "clear") { this.GroupSettings.Clear(); } return base.OnDeserializeUnrecognizedElement(elementName, reader); }