Exemple #1
0
        public PwObjectList <T> CloneShallow()
        {
            PwObjectList <T> tNew = new PwObjectList <T>();

            foreach (T po in m_vObjects)
            {
                tNew.Add(po);
            }

            return(tNew);
        }
Exemple #2
0
        /// <summary>
        /// Clone the current <c>PwObjectList</c>, including all
        /// stored objects (deep copy).
        /// </summary>
        /// <returns>New <c>PwObjectList</c>.</returns>
        public PwObjectList <T> CloneDeep()
        {
            PwObjectList <T> pl = new PwObjectList <T>();

            foreach (T po in m_vObjects)
            {
                pl.Add(po.CloneDeep());
            }

            return(pl);
        }
Exemple #3
0
        public static PwObjectList <T> FromList(List <T> tList)
        {
            if (tList == null)
            {
                throw new ArgumentNullException("tList");
            }

            PwObjectList <T> l = new PwObjectList <T>();

            l.Add(tList);
            return(l);
        }
Exemple #4
0
        public static PwObjectList <T> FromArray(T[] tArray)
        {
            if (tArray == null)
            {
                throw new ArgumentNullException("tArray");
            }

            PwObjectList <T> l = new PwObjectList <T>();

            foreach (T t in tArray)
            {
                l.Add(t);
            }
            return(l);
        }