Пример #1
0
        public static BLM Load()
        {
            if (!File.Exists(DBFilePath))
            {
                BLM blm = new BLM();

                blm.Save();

                return(blm);
            }

            using (FileStream fs = new FileStream(DBFilePath, FileMode.Open))
            {
                BinaryFormatter formatter = new BinaryFormatter();
                BLM             context   = (BLM)formatter.Deserialize(fs);
                return(context);
            }
        }
Пример #2
0
        public static BLM Load()
        {
            if (!File.Exists(DBFilePath))
            {
                BLM blm = new BLM();

                blm.Save();

                return blm;
            }

            using (FileStream fs = new FileStream(DBFilePath, FileMode.Open))
            {
                BinaryFormatter formatter = new BinaryFormatter();
                BLM context = (BLM)formatter.Deserialize(fs);
                return context;
            }
        }