Beispiel #1
0
        public override void Run()
        {
            StatusLogger.UpdateMessage(StatusMessage);

            List <PwGroup> touchedGroups            = new List <PwGroup>();
            List <PwGroup> permanentlyDeletedGroups = new List <PwGroup>();

            Android.Util.Log.Debug("KP2A", "Calling PerformDelete..");
            PerformDelete(touchedGroups, permanentlyDeletedGroups);

            _onFinishToRun = new ActionOnFinish(ActiveActivity, (success, message, activity) =>
            {
                if (success)
                {
                    foreach (var g in touchedGroups)
                    {
                        App.DirtyGroups.Add(g);
                    }
                    foreach (var g in permanentlyDeletedGroups)
                    {
                        //remove groups from global lists if present there
                        App.DirtyGroups.Remove(g);
                        Db.GroupsById.Remove(g.Uuid);
                        Db.Elements.Remove(g);
                    }
                }
                else
                {
                    // Let's not bother recovering from a failure to save.  It is too much work.
                    App.Lock(false);
                }
            }, OnFinishToRun);

            // Commit database
            SaveDb save = new SaveDb(Ctx, App, Db, OnFinishToRun, false);

            save.ShowDatabaseIocInStatus = ShowDatabaseIocInStatus;

            save.SetStatusLogger(StatusLogger);
            save.Run();
        }