Ejemplo n.º 1
0
 /// <summary>
 ///   Creates a shallow clone of the specified object, reusing any referenced objects
 /// </summary>
 /// <typeparam name="TCloned">Type of the object that will be cloned</typeparam>
 /// <param name="objectToClone">Object that will be cloned</param>
 /// <returns>A shallow clone of the provided object</returns>
 TCloned ICloneFactory.ShallowPropertyClone <TCloned>(TCloned objectToClone)
 {
     if (typeof(TCloned).IsClass || typeof(TCloned).IsArray)
     {
         if (ReferenceEquals(objectToClone, null))
         {
             return(default(TCloned));
         }
     }
     return(ReflectionCloner.ShallowPropertyClone <TCloned>(objectToClone));
 }
Ejemplo n.º 2
0
 /// <summary>
 ///   Creates a deep clone of the specified object, also creating clones of all
 ///   child objects being referenced
 /// </summary>
 /// <typeparam name="TCloned">Type of the object that will be cloned</typeparam>
 /// <param name="objectToClone">Object that will be cloned</param>
 /// <returns>A deep clone of the provided object</returns>
 TCloned ICloneFactory.DeepPropertyClone <TCloned>(TCloned objectToClone)
 {
     return(ReflectionCloner.DeepPropertyClone <TCloned>(objectToClone));
 }
Ejemplo n.º 3
0
 /// <summary>
 ///   Creates a deep clone of the specified object, also creating clones of all
 ///   child objects being referenced
 /// </summary>
 /// <typeparam name="TCloned">Type of the object that will be cloned</typeparam>
 /// <param name="objectToClone">Object that will be cloned</param>
 /// <returns>A deep clone of the provided object</returns>
 TCloned ICloneFactory.DeepFieldClone <TCloned>(TCloned objectToClone)
 {
     return(ReflectionCloner.DeepFieldClone <TCloned>(objectToClone));
 }