/// <summary> /// Gets all messages on the stack. /// </summary> /// <returns>Array of strings on the stack.</returns> public static string[] GetAllMessages() { return(NestedDiagnosticsContext.GetAllMessages()); }
/// <summary> /// Clears current thread NDC stack. /// </summary> public static void Clear() { NestedDiagnosticsContext.Clear(); }
/// <summary> /// Pops the top object off the NDC stack. The object is removed from the stack. /// </summary> /// <returns>The top object from the NDC stack, if defined; otherwise <c>null</c>.</returns> public static object PopObject() { return(NestedDiagnosticsContext.PopObject()); }
/// <summary> /// Pops the top message off the NDC stack. /// </summary> /// <returns>The top message which is no longer on the stack.</returns> public static string Pop() { return(NestedDiagnosticsContext.Pop()); }
/// <summary> /// Pushes the specified text on current thread NDC. /// </summary> /// <param name="text">The text to be pushed.</param> /// <returns>An instance of the object that implements IDisposable that returns the stack to the previous level when IDisposable.Dispose() is called. To be used with C# using() statement.</returns> public static IDisposable Push(string text) { return(NestedDiagnosticsContext.Push(text)); }
/// <summary> /// Gets all objects on the NDC stack. The objects are not removed from the stack. /// </summary> /// <returns>Array of objects on the stack.</returns> public static object[] GetAllObjects() { return(NestedDiagnosticsContext.GetAllObjects()); }