示例#1
0
        /// <summary>
        /// Clones the array and all items in the array.
        /// </summary>
        /// <returns>A new DistributionArray.</returns>
        public object Clone()
        {
            Array newArray = (Array)array.Clone();
            DistributionArray <T> result = new DistributionArray <T>(newArray);

            result.ModifyAll(delegate(T item) { return((T)item.Clone()); });
            return(result);
        }
示例#2
0
        public static DistributionArray <T> CloneElementsOf(Array array)
        {
            DistributionArray <T> result = new DistributionArray <T>(StringUtil.ArrayDimensions(array));

            result.ModifyAll(array, delegate(T item, T aItem)
            {
                return((T)aItem.Clone());
            });
            return(result);
        }