//returns back recently deleted point (own), if there is one and its topic still exists private void TryUndo() { if (recentlyDeleted == null) { Console.Beep(); return; } var np = DaoUtils.clonePoint(PrivateCenterCtx.Get(), recentlyDeleted.point, recentlyDeleted.topic, recentlyDeleted.person, recentlyDeleted.point.Point); DaoUtils.DeleteArgPoint(PrivateCenterCtx.Get(), recentlyDeleted.point); recentlyDeleted = null; if (np == null) { return; } lstTopics.SelectedItem = null; lstTopics.SelectedItem = np.Topic; lstPoints.SelectedItem = new ArgPointExt(np); saveProcedure(null, -1); }
private void btnRemovePoint_Click(object sender, RoutedEventArgs e) { if (DateTime.Now.Subtract(_recentRemovalStamp).TotalSeconds < 2.0) { return; } _recentRemovalStamp = DateTime.Now; ArgPoint ap; Topic t; getPointAndTopic(out ap, out t); if (ap == null) { return; } if (ap.Person.Id != SessionInfo.Get().person.Id) { return; } BusyWndSingleton.Show("Removing argument..."); try { if (ap.Topic != null) { Topic t1 = ap.Topic; recentlyDeleted = new PointRemoveRecord(); recentlyDeleted.person = ap.Person; recentlyDeleted.point = ap; recentlyDeleted.topic = ap.Topic; PublicBoardCtx.DropContext(); DaoUtils.UnattachPoint(ap); RenumberPointsAfterDeletion(t1, SessionInfo.Get().person.Id); UpdatePointsOfTopic(t1); saveProcedure(ap, t1.Id); } } finally { BusyWndSingleton.Hide(); } }
private void btnRemovePoint_Click(object sender, RoutedEventArgs e) { if (DateTime.Now.Subtract(_recentRemovalStamp).TotalSeconds < 2.0) return; _recentRemovalStamp = DateTime.Now; ArgPoint ap; Topic t; getPointAndTopic(out ap, out t); if (ap == null) return; if (ap.Person.Id != SessionInfo.Get().person.Id) return; BusyWndSingleton.Show("Removing argument..."); try { if (ap.Topic != null) { Topic t1 = ap.Topic; recentlyDeleted = new PointRemoveRecord(); recentlyDeleted.person = ap.Person; recentlyDeleted.point = ap; recentlyDeleted.topic = ap.Topic; PublicBoardCtx.DropContext(); DaoUtils.UnattachPoint(ap); RenumberPointsAfterDeletion(t1, SessionInfo.Get().person.Id); UpdatePointsOfTopic(t1); saveProcedure(ap, t1.Id); } } finally { BusyWndSingleton.Hide(); } }