예제 #1
0
 /// <summary>
 /// Returns a clone of either a graph or a match or a container
 /// </summary>
 /// <param name="toBeCloned">The graph or match or container to be cloned</param>
 /// <returns>The cloned graph or match or container</returns>
 public static object Clone(object toBeCloned)
 {
     if (toBeCloned is IGraph)
     {
         return(GraphHelper.Copy((IGraph)toBeCloned));
     }
     else if (toBeCloned is IMatch)
     {
         return(((IMatch)toBeCloned).Clone());
     }
     else
     {
         return(ContainerHelper.Clone(toBeCloned));
     }
 }
예제 #2
0
 /// <summary>
 /// Returns a shallow clone of either a graph or a match or a class object or a transient class object or a container
 /// </summary>
 /// <param name="toBeCloned">The graph or match or (transient) class object or container to be cloned</param>
 /// <returns>The clone</returns>
 public static object Clone(object toBeCloned, IGraph graph)
 {
     if (toBeCloned is IGraph)
     {
         return(GraphHelper.Copy((IGraph)toBeCloned));
     }
     else if (toBeCloned is IMatch)
     {
         return(((IMatch)toBeCloned).Clone());
     }
     else if (toBeCloned is IObject)
     {
         return(((IObject)toBeCloned).Clone(graph));
     }
     else if (toBeCloned is ITransientObject)
     {
         return(((ITransientObject)toBeCloned).Clone());
     }
     else
     {
         return(ContainerHelper.Clone(toBeCloned));
     }
 }