Пример #1
0
        public XBaseCollection Copy()
        {
            XBaseCollection clone = new XBaseCollection();

            foreach (XBase c in List)
            {
                clone.Add(c);
            }

            return(clone);
        }
Пример #2
0
        public virtual XBase Add(XBase value)
        {
            //if( value == null || TypeHelper.IsXMLObjectType( value.GetType() ) == false )
            if (value == null)
            {
                throw new ArgumentNullException();
            }
            if (value.GetType() != _ChildItemType)
            {
                throw new Exception("类型不正确。请输入类型为" + XObjectHelper.XBaseType.ToString() + "的变量。_ChildItemType=" + _ChildItemType.ToString() + " valueType" + value.GetType().ToString());
            }

            // Use base class to process actual collection operation
            return(_List.Add(value));
        }