private void genBListBNList() { Save.Save save = new Save.Save(); ////using (FileStream fs=new FileStream("d:\\temp.txt",FileMode.Create)) ////{ ////} //Serializer_Deserializer_Database.Biare.Binare s; //using (StreamWriter sw = new StreamWriter(Save.SaveSetting.Default.phat, false)) //{ // sw.Write(Save.SaveSetting.Default.SaveObject); //} //if (new FileInfo(Save.SaveSetting.Default.phat).Length != 0) //{ // s = new Serializer_Deserializer_Database.Biare.Binare(); // save = (Save.Save)s.DeSerialize(Save.SaveSetting.Default.phat); //} save = _mw.save; if (save != null) { for (int i = 0; i < save._bike.Count; i++) { _bnList.Add(save._bike[i].name); _bList.Add(save._bike[i]); } } //lade }
public Editor(MainWindow mw) { _mw = mw;//----------------------------------------------------------------------------------------------------------------------------- save = mw.save; InitializeComponent(); }
private void load() { if (!File.Exists(Save.SaveSetting.Default.path)) { save = new Save.Save(); return; } try { FileStream fs = new FileStream(Save.SaveSetting.Default.path,FileMode.Open); XmlSerializer s = new XmlSerializer(typeof(Save.Save)); save = (Save.Save)s.Deserialize(fs); fs.Close(); } catch (Exception ex) { } }
private void load() { if (!File.Exists(Save.SaveSetting.Default.path)) { save = new Save.Save(); return; } try { FileStream fs = new FileStream(Save.SaveSetting.Default.path, FileMode.Open); XmlSerializer s = new XmlSerializer(typeof(Save.Save)); save = (Save.Save)s.Deserialize(fs); fs.Close(); } catch (Exception ex) { } }