Пример #1
0
        //
        // static methods
        //

        #region public static DBValueGroup Empty()

        public static DBValueGroup Empty()
        {
            DBClauseList list = new DBClauseList();

            DBValueGroupRef values = new DBValueGroupRef();

            values.GroupItems = null;

            return(values);
        }
Пример #2
0
        //
        // methods
        //

        #region public DBValueGroup Add(DBClause item)

        public DBValueGroup Add(DBClause item)
        {
            if (this.GroupItems == null)
            {
                this.GroupItems = new DBClauseList();
            }

            this.GroupItems.Add(item);

            return(this);
        }
Пример #3
0
        public static DBValueGroup All(params DBClause[] items)
        {
            DBClauseList list = new DBClauseList();

            list.AddRange(items);
            DBValueGroupRef values = new DBValueGroupRef();

            values.GroupItems = list;

            return(values);
        }
Пример #4
0
        public DBValueGroup AddRange(IEnumerable <DBClause> items)
        {
            if (this.GroupItems == null)
            {
                this.GroupItems = new DBClauseList();
            }
            if (null != items)
            {
                foreach (DBClause c in items)
                {
                    this.GroupItems.Add(c);
                }
            }

            return(this);
        }
Пример #5
0
        /// <summary>
        /// Reads an inner list of elements, creating a new DBClause for each element and adding it to the collection
        /// </summary>
        /// <param name="list"></param>
        /// <param name="endelement"></param>
        /// <param name="reader"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        protected bool ReadInnerElementList(DBClauseList list, string endelement, XmlReader reader, XmlReaderContext context)
        {
            int count = 0;

            do
            {
                if (reader.NodeType == XmlNodeType.EndElement && this.IsElementMatch(endelement, reader, context))
                {
                    break;
                }
                else if (reader.NodeType == XmlNodeType.Element)
                {
                    DBClause c = context.Factory.Read(reader.LocalName, reader, context);
                    if (c != null)
                    {
                        list.Add(c);
                        count++;
                    }
                }
            } while (reader.Read());

            return(count > 0);
        }