/// <summary> /// Sets the trace. /// </summary> /// <param name="level"> /// The level. /// </param> /// <param name="options"> /// The options. /// </param> public static void SetTrace(SourceLevels level, TraceOptions options) { if (listener == null) { listener = new BindingErrorTraceListener(); PresentationTraceSources.DataBindingSource.Listeners.Add(listener); } listener.TraceOutputOptions = options; PresentationTraceSources.DataBindingSource.Switch.Level = level; }
/// <summary> /// Closes the trace. /// </summary> public static void CloseTrace() { if (listener == null) { return; } listener.Flush(); listener.Close(); PresentationTraceSources.DataBindingSource.Listeners.Remove(listener); listener = null; }