Пример #1
0
 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);
 }
Пример #2
0
        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);
        }
Пример #3
0
        public xmlAttrib Attribute(String attrName)
        {
            xmlAttrib childAttr = pAttributes.Find(
                delegate(xmlAttrib attr)
            {
                return(attr.Name == attrName);
            });

            return(childAttr);
        }
Пример #4
0
 public xmlAttrib(xmlAttrib source)
 {
     attributeName  = source.attributeName;
     attributeValue = source.attributeValue;
 }
Пример #5
0
 public xmlAttrib(xmlAttrib source)
 {
     attributeName = source.attributeName;
     attributeValue = source.attributeValue;
 }