示例#1
0
        protected override void Cancel(NativeActivityContext context)
        {
            Bookmark       timerBookmark  = this.timerBookmark.Get(context);
            TimerExtension timerExtension = GetTimerExtension(context);

            timerExtension.CancelTimer(timerBookmark);
            context.RemoveBookmark(timerBookmark);
            context.MarkCanceled();
        }
示例#2
0
        protected override void Abort(NativeActivityAbortContext context)
        {
            Bookmark timerBookmark = this.timerBookmark.Get(context);

            // The bookmark could be null in abort when user passed in a negative delay as a duration
            if (timerBookmark != null)
            {
                TimerExtension timerExtension = GetTimerExtension(context);
                timerExtension.CancelTimer(timerBookmark);
            }
            base.Abort(context);
        }