示例#1
0
文件: AppTask.cs 项目: 77rusa/README
        public override void CompleteOnCreateEntryActivity(EntryActivity activity)
        {
            Context ctx = activity;

            if (ctx == null)
            {
                ctx = Application.Context;
            }

            if ((ShowUserNotifications == ShowUserNotificationsMode.Always) ||
                ((ShowUserNotifications == ShowUserNotificationsMode.WhenTotp) && new Kp2aTotp().TryGetAdapter(new PwEntryOutput(activity.Entry, App.Kp2a.CurrentDb)) != null))
            {
                //show the notifications
                activity.StartNotificationsService(ActivateKeyboard);
            }
            else
            {
                //to avoid getting into inconsistent state (LastOpenedEntry and Notifications): clear notifications:
                CopyToClipboardService.CancelNotifications(activity);
            }
            if (CloseAfterCreate)
            {
                //close
                activity.CloseAfterTaskComplete();
            }
        }
示例#2
0
        public override void CompleteOnCreateEntryActivity(EntryActivity activity)
        {
            Context ctx = activity;

            if (ctx == null)
            {
                ctx = Application.Context;
            }

            if (ShowUserNotifications)
            {
                //show the notifications
                activity.StartNotificationsService(CloseAfterCreate);
            }
            else
            {
                //to avoid getting into inconsistent state (LastOpenedEntry and Notifications): clear notifications:
                CopyToClipboardService.CancelNotifications(activity);
            }
            if (CloseAfterCreate)
            {
                //close
                activity.CloseAfterTaskComplete();
            }
        }