Пример #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);
        }