private static MemberExtension ParseMember(XmlNode memberNode) { MemberExtension ext = new MemberExtension(); if (memberNode.Attributes != null) { foreach (XmlAttribute attr in memberNode.Attributes) { if (attr.LocalName == AttrName.Name) { ext.Name = attr.Value; } else { ext.Attributes.Add(attr.LocalName, attr.Value); } } } foreach (XmlNode node in memberNode.ChildNodes) { ext.Attributes.Add(ParseAttribute(node)); } return(ext); }
public void Add(MemberExtension memberInfo) { if (this != _null) { _members[memberInfo.Name] = memberInfo; } }
private static void MergeExtensions(MemberExtension fromExt, ref MemberExtension toExt) { foreach (var attribute in fromExt.Attributes) { if (toExt.Attributes.ContainsKey(attribute.Key)) { toExt.Attributes.Remove(attribute.Key); } toExt.Attributes.Add(attribute.Key, attribute.Value); } }
public MemberExtension this[string memberName] { get { if (this == _null) { return(MemberExtension.Null); } MemberExtension value = (MemberExtension)_members[memberName]; return(value ?? MemberExtension.Null); } }
private static MemberExtension ParseMember(XElement memberNode) { var ext = new MemberExtension(); foreach (var attr in memberNode.Attributes()) { if (attr.Name.LocalName == AttrName.Name) { ext.Name = attr.Value; } else { ext.Attributes.Add(attr.Name.LocalName, attr.Value); } } foreach (var node in memberNode.Elements()) { ext.Attributes.Add(ParseAttribute(node)); } return(ext); }
private static MemberExtension ParseMember(XElement memberNode) { var ext = new MemberExtension(); foreach (var attr in memberNode.Attributes()) { if (attr.Name.LocalName == AttrName.Name) ext.Name = attr.Value; else ext.Attributes.Add(attr.Name.LocalName, attr.Value); } foreach (var node in memberNode.Elements()) ext.Attributes.Add(ParseAttribute(node)); return ext; }
private static MemberExtension ParseMember(XmlNode memberNode) { MemberExtension ext = new MemberExtension(); if (memberNode.Attributes != null) { foreach (XmlAttribute attr in memberNode.Attributes) { if (attr.LocalName == AttrName.Name) ext.Name = attr.Value; else ext.Attributes.Add(attr.LocalName, attr.Value); } } foreach (XmlNode node in memberNode.ChildNodes) ext.Attributes.Add(ParseAttribute(node)); return ext; }