コード例 #1
0
        internal void EndContext(SpanBuildContextModel model)
        {
            lock (contextLock)
            {
                if (stack.Peek() != model)
                {
                    return;
                }

                EndContext();
            }
        }
コード例 #2
0
        private SpanBuildContext StartContext(Func <Span, IInline> factoryMethod)
        {
            lock (contextLock)
            {
                if (rootSpanHolder == null)
                {
                    rootSpanHolder = current;
                }

                SpanBuildContextModel model   = new SpanBuildContextModel(factoryMethod, current, current.Children.Count, this);
                SpanBuildContext      context = new SpanBuildContext(model);

                stack.Push(model);
                current = new Span();
                return(context);
            }
        }
コード例 #3
0
        public ISpanBuilder EndContext()
        {
            if (stack.Count < 1)
            {
                return(this);
            }

            SpanBuildContextModel model = stack.Pop();

            model.LockResultSpan(current);
            current = model.BuildModifieredParent();

            if (stack.Count < 1)
            {
                rootSpanHolder = null;
            }

            return(this);
        }
コード例 #4
0
 internal SpanBuildContext(SpanBuildContextModel model)
 {
     this.model = model;
     model.SetContext(this);
     builder = model.Builder;
 }