Ejemplo n.º 1
0
        public static void save_data(string file = "file.binf")
        {
            Data2 d2 = new Data2();
            SerializableObject obj = new SerializableObject();

            obj.Data2 = d2;
            MySerializer serializer = new MySerializer();

            serializer.SerializeObject(file, obj);
            Console.WriteLine("Data saved to file: " + file);
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public static void load_data(string file = "file.binf")
        {
            if (file == "")
            {
                return;
            }
            MySerializer serializer = new MySerializer();
            Data2        d2         = serializer.DeserializeObject(file).Data2;

            Tasks = new List <Task>(Tasks.Union(d2.tasks));
            //Tasks = d2.tasks;
            Task.lastid = Tasks[Tasks.Count - 1].Id;
            Console.WriteLine("Data loaded from file: " + file);
            Console.ReadKey();
        }