System.Diagnostics.TraceListener.Write C# (CSharp) Method

Write() public method

public Write ( object o, string category ) : void
o object
category string
return void
        public virtual void Write(object o, string category)
        {
            if (Filter != null && !Filter.ShouldTrace(null, "", TraceEventType.Verbose, 0, category, null, o))
                return;

            if (category == null)
                Write(o);
            else
                Write(o == null ? "" : o.ToString(), category);
        }

Same methods

TraceListener::Write ( object o ) : void
TraceListener::Write ( string message ) : void
TraceListener::Write ( string message, string category ) : void

Usage Example

Beispiel #1
0
        public static void Write(string message, string category)
        {
            object listenersSyncRoot = TraceImpl.ListenersSyncRoot;

            lock (listenersSyncRoot)
            {
                foreach (object obj in TraceImpl.Listeners)
                {
                    TraceListener traceListener = (TraceListener)obj;
                    traceListener.Write(message, category);
                    if (TraceImpl.AutoFlush)
                    {
                        traceListener.Flush();
                    }
                }
            }
        }
All Usage Examples Of System.Diagnostics.TraceListener::Write