Exemple #1
0
        protected string GetNodeXMLString(string propName, bool isdata)
        {
            if (propName == null || propName.Length < 1)
            {
                return("");
            }

            object o    = GetValueEx(propName);
            Type   type = o.GetType();

            if (XObjectHelper.IsXObjectType(type))
            {
                XObject item = o as XObject;
                //XObject item = GetValueEx( propName ) as XObject;
                if (item == null)
                {
                    return(XObjectHelper.GetEmptyElement(propName));
                }
                return(item.ToFullString(propName));
            }

            if (XObjectHelper.IsXObjectCollectionType(type))
            {
                XObjectCollection col = o as XObjectCollection;
                //XObjectCollection col = GetValueEx( propName ) as XObjectCollection;
                if (col == null)
                {
                    return(XObjectHelper.GetEmptyElement(propName));
                }
                return(col.ToFullString(propName));
            }

            //return XObjectHelper.GetXMLElement( propName, GetValueEx( propName ), isdata );
            return(XObjectHelper.GetXMLElement(propName, o, isdata));
        }
Exemple #2
0
        public XObjectCollection Copy()
        {
            XObjectCollection clone = new XObjectCollection(_ChildItemType);

            // Copy each reference across
            foreach (XBase c in _List)
            {
                clone.Add(c);
            }

            return(clone);
        }