예제 #1
0
        public static void ThrowIfCancellationRequested()
        {
            NotifyObject obj;

            if (currentStatus.TryGetValue(NotifierId.GetKey(Thread.CurrentThread), out obj))
            {
                obj.ThrowIfCancellationRequested();
            }
        }
예제 #2
0
        public static void Report(Progress progress)
        {
            NotifyObject obj;

            if (currentStatus.TryGetValue(NotifierId.GetKey(Thread.CurrentThread), out obj))
            {
                obj.Progress(progress);
            }
        }
예제 #3
0
        public static bool IsCancellationRequested()
        {
            NotifyObject obj;

            if (currentStatus.TryGetValue(NotifierId.GetKey(Thread.CurrentThread), out obj))
            {
                return(obj.IsCancellationRequested());
            }
            return(false);
        }
예제 #4
0
 internal ProgressNotifierScope(NotifyObject status)
 {
     key = NotifierId.GetKey(Thread.CurrentThread);
     ProgressNotifier.AddNotifyObject(key, status);
 }
예제 #5
0
 internal static void AddNotifyObject(NotifierId key, NotifyObject notifyObj)
 {
     currentStatus.TryAdd(key, notifyObj);
 }
예제 #6
0
        internal static void Clear(NotifierId key)
        {
            NotifyObject obj;

            currentStatus.TryRemove(key, out obj);
        }