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); } }
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; } }