Beispiel #1
0
        public static void Serialize(AsmInfo asm, string path, object obj)
        {
            path = asm.InAppDir(path);

            using (Stream stream = File.OpenWrite(path)) {
                BinaryFormatter formatter = new BinaryFormatter();
                formatter.Serialize(stream, obj);
            }
        }
Beispiel #2
0
        public static object Deserialize(AsmInfo asm, string path)
        {
            path = asm.InAppDir(path);

            object obj = null;
            using (Stream stream = File.OpenRead(path)) {
                BinaryFormatter formatter = new BinaryFormatter();
                obj = formatter.Deserialize(stream);
            }
            return obj;
        }