private static ICloner <T> GetDeconstructCloner(Type type) { var pair = TypeHelper.GetConstructorDeconstructPair(type); if (pair == null) { return(null); } return(DeconstructCloner.GetInstance(pair.Item1, pair.Item2)); }
public static ICloner <T> GetInstance(MethodInfo deconstruct, ConstructorInfo constructor) { var found = _instance; if (found == null) { var created = new DeconstructCloner(deconstruct, constructor); found = Interlocked.CompareExchange(ref _instance, created, null); if (found == null) { return(created); } } return(found); }