Esempio n. 1
0
        public static void Start(ActivityScope scope)
        {
            ActivityScope parent = ActivityStack.Count > 0 ? ActivityStack.Peek() : null;

            if (parent != null)
            {
                scope.ParentId = parent.Id;
            }

            ActivityStack.Push(scope);
        }
Esempio n. 2
0
        public static void Start(ActivityScope scope)
        {
            var parent = ActivityStack.Any() ? ActivityStack.Peek() : null;

            if (parent != null)
            {
                scope.ParentId = parent.Id;
            }

            ActivityStack = ActivityStack.Push(scope);
        }
Esempio n. 3
0
        public static void End(ActivityScope scope)
        {
            if (Current == null)
            {
                return;
            }

            if (!ActivityStack.Any(scopeOnTheStack => scope.Id == scopeOnTheStack.Id))
            {
                return;
            }

            ActivityScope currentScope = ActivityStack.Pop();

            while (ActivityStack.Count > 0 && currentScope.Id != scope.Id)
            {
                currentScope = ActivityStack.Pop();
            }
        }
Esempio n. 4
0
        public static void End(ActivityScope scope)
        {
            if (Current == null)
            {
                return;
            }

            if (ActivityStack.All(scopeOnTheStack => scope.Id != scopeOnTheStack.Id))
            {
                return;
            }

            ActivityScope currentScope;

            ActivityStack = ActivityStack.Pop(out currentScope);

            while (ActivityStack.Any() && currentScope.Id != scope.Id)
            {
                ActivityStack = ActivityStack.Pop(out currentScope);
            }
        }