Object Cloner

internal static class ObjectCloner

{

public static object Clone(object obj)

{

using (MemoryStream buffer = new MemoryStream())

{

BinaryFormatter formatter = new BinaryFormatter();

formatter.Serialize(buffer, obj);

buffer.Position = 0;

object temp = formatter.Deserialize(buffer);

return temp;

}

}

}

06 Ağustos 2007 Pazartesi 12:06 gönderen MuratHAKSAL
Filed Under: , ,

Yorumlar