public void SetDataObj(object obj) { var type = obj.GetType(); this.AssemblyName = type.Assembly.GetName().Name; this.TypeName = type.FullName; this.DataBytes = CtkObject.DataContractSerializeToByte(obj); }
public Object GetDataObj() { var assembly = (from row in AppDomain.CurrentDomain.GetAssemblies() where row.GetName().Name == this.AssemblyName select row).FirstOrDefault(); var type = assembly.GetType(this.TypeName); return(CtkObject.DataContractDeserialize(type, this.DataBytes)); }