예제 #1
0
        /// <summary>
        /// Creates a plain copy of the objects that contains same values.
        /// </summary>
        /// <returns>Exact plain copy of the object.</returns>
        public DriftControl PlainCopy()
        {
            var result     = new DriftControl();
            var ThisType   = this.GetType();
            var ResultType = result.GetType();

            foreach (var ThisProperty in ThisType.GetProperties())
            {
                var ResultField = ResultType.GetProperty(ThisProperty.Name);
                ResultField.SetValue(result, ThisProperty.GetValue(this));
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Creates a plain copy of the objects that contains same values.
        /// </summary>
        /// <returns>Exact plain copy of the object.</returns>
        public Transmission PlainCopy()
        {
            var result     = new Transmission();
            var ThisType   = this.GetType();
            var ResultType = result.GetType();

            foreach (var ThisProperty in ThisType.GetProperties())
            {
                var ResultField = ResultType.GetProperty(ThisProperty.Name);
                ResultField.SetValue(result, ThisProperty.GetValue(this));
            }
            return(result);
        }