public bool replaceChildByAttrValue(String attrName, String attrValue, xmlElem replacingNode) { for (int i = 0; i < pElements.Count; i++) { xmlAttrib childAttr = pElements[i].pAttributes.Find( delegate(xmlAttrib attr) { return(attr.Name == attrName); }); try { if (childAttr.Value == attrValue) { this.pElements[i] = new xmlElem(replacingNode); //this.Remove(pElements[i]); //this.Add(replacingNode); OnPropertyChanged("xmlElements"); OnPropertyChanged("childRearingElements"); OnPropertyChanged("dummyElements"); OnPropertyChanged("lonelyElements"); OnPropertyChanged("AttributeElements"); return(true); } } catch { continue; } } return(false); }
public xmlElem firstChildByAttrValue(String attrName, String attrValue) { //List<xmlElem> tempList = pElements; for (int i = 0; i < pElements.Count; i++) { xmlAttrib childAttr = pElements[i].pAttributes.Find( delegate(xmlAttrib attr) { return(attr.Name == attrName); }); try { if (childAttr.Value == attrValue) { return(pElements[i]); } } catch { continue; } } return(null); }
public xmlAttrib Attribute(String attrName) { xmlAttrib childAttr = pAttributes.Find( delegate(xmlAttrib attr) { return(attr.Name == attrName); }); return(childAttr); }
public xmlAttrib(xmlAttrib source) { attributeName = source.attributeName; attributeValue = source.attributeValue; }