Exemplo n.º 1
0
        /// <summary>
        /// Enter a new message context and associate data with it.
        /// </summary>
        /// <param name="context">The context to be set.</param>
        public static void EnterContext(DebugContext context)
        {
            if(context == null) {
                throw new ArgumentNullException("context");
            }

            // push the context on the stack
            context.Depth = contextStack.Count + 1;
            contextStack.Push(context);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Enter a new message context.
        /// </summary>
        /// <param name="name">The name of the new context.</param>
        public static void EnterContext(string name)
        {
            if(name == null) {
                throw new ArgumentNullException("name");
            }

            // push the context on the stack
            DebugContext context = new DebugContext(name);
            context.Depth = contextStack.Count + 1;
            contextStack.Push(context);
        }