Ejemplo n.º 1
0
        /// <summary>
        /// Creates a copy of the object.
        /// </summary>
        /// <returns>The copy of the object.</returns>
        virtual public T Copy <T>()
        {
            ICopyable obj  = null;
            Type      type = GetType();

            obj = Activator.CreateInstance(type) as ICopyable;

            // Duplicate our values
            if (obj is T)
            {
                obj.CopyFrom(this);
                return((T)obj);
            }
            return(default(T));
        }