public static T Clone <T> (this T source) { if (Object.ReferenceEquals(source, null)) { return(default(T)); } Stream s = new MemoryStream(); using (s) { SerializableObject.Save <T>(source, s); s.Seek(0, SeekOrigin.Begin); return(SerializableObject.Load <T>(s)); } }
public void Save(string filePath) { SerializableObject.Save(this, filePath); }