示例#1
0
        //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);
        }