private void DeserialButton_Click(object sender, EventArgs e) { jtttLog.log("Wcisnieto przycisk deserializacji."); using (var tmp = new JTTTDBContext()) { foreach (var item in listOFTasks) { JTTTAction action = tmp.JTTTActions.Find(item.Id); if (action != null) { tmp.JTTTActions.Remove(action); } } listOFTasks = (BindingList <JTTTRecipe>)serializer.Deserialize("JTTTser.dat"); foreach (var item in listOFTasks) { tmp.JTTTRecipes.Add(item); jtttLog.log(string.Format("Dodano zdarzenie: {0}.", item)); } tmp.SaveChanges(); tasksListBox.DataSource = listOFTasks; } }
public JTTTRecipe(JTTTAction action, JTTTQuestion question) { Action = action; Question = question; }