public static ProcessLiteInfo Deserialize(byte[] bytes) { var r = new ProcessLiteInfo(); List <object> list = (List <object>)CraftSynth.BuildingBlocks.IO.Xml.Misc.Deserialize(bytes, false); int version = (int)list[0]; if (version == 1) { r.Id = (int)list[1]; r.Name = (string)list[2]; r.FilePath = (string)list[3]; r.MainWindowTitle = (string)list[4]; } else if (version == 2) { r.Id = (int)list[1]; r.Name = (string)list[2]; r.FilePath = (string)list[3]; r.MainWindowTitle = (string)list[4]; r.IconBytes = (byte[])list[5]; } else { throw new Exception("ProcessLiteInfo.Deserialize: version not recognized. Version=" + version ?? "null"); } return(r); }
public static decimal SizeInBytesOfManagedPartOrIfNullZero(this ProcessLiteInfo pli) { if (pli == null) { return(0); } else { return(pli.SizeInBytesOfManagedpart()); } }
public static ProcessLiteInfo DeserializeOrIfNullReturnNull(this byte[] bytes) { if (bytes == null) { return(null); } else { return(ProcessLiteInfo.Deserialize(bytes)); } }
public static byte[] SerializeOrIfNullReturnNull(this ProcessLiteInfo pli) { if (pli == null) { return(null); } else { return(pli.Serialize()); } }