示例#1
0
        } // end GetEnumerator

        IEnumerator <object> IEnumerable <object> .GetEnumerator()
        {
            foreach (object obj in wrappedObject)
            {
                yield return(DynObject.Wrap(obj));
            } // end foreach
        }     // end GetEnumerator
示例#2
0
        }     // end DynList

        #region DynList Overrides

        /// <summary>
        /// Accessor method of members of the list. Returns those objects wrapped by DynObject.
        /// </summary>
        /// <param name="index">The index of the time we're retrieving.</param>
        /// <returns>The object, as returned by DynObject.Wrap.</returns>
        public object this[int index]
        {
            get
            {
                return(DynObject.Wrap(wrappedObject[index]));
            } // end get
            set
            {
                // If we're trying to set DynList or DynObject, we really should only set the underlying object.
                // This really helps keep things clean, and serializable.
                if (value is DynObject)
                {
                    wrappedObject[index] = ((DynObject)value).wrappedObject;
                }
                else if (value is DynList)
                {
                    wrappedObject[index] = ((DynList)value).wrappedObject;
                }
                else
                {
                    wrappedObject[index] = value;
                } // end if
            }     // end set
        }         // end object this[]