Exemple #1
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if ((this.traceSource != null) && this.traceSource.get_Switch().ShouldTrace((TraceEventType)TraceEventType.Stop))
         {
             if ((this._message == null) || (this._message == string.Empty))
             {
                 this.traceSource.TraceImpl((TraceEventType)TraceEventType.Stop, this._stackLevel, string.Empty);
             }
             else
             {
                 this.traceSource.TraceImpl((TraceEventType)TraceEventType.Stop, this._stackLevel, this._message, this._args);
             }
         }
         this.traceSource = null;
         this._message    = null;
         this._args       = null;
     }
 }
Exemple #2
0
 protected MethodTraceBase(TcTraceSource source, string message, params object[] args)
 {
     this._stackLevel = 3;
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     this.traceSource = source;
     if (this.traceSource.get_Switch().ShouldTrace((TraceEventType)TraceEventType.Start))
     {
         this._stackLevel++;
         this._message = message;
         this._args    = args;
         if ((this._message == null) || (this._message == string.Empty))
         {
             this.traceSource.TraceImpl((TraceEventType)TraceEventType.Start, this._stackLevel, string.Empty);
         }
         else
         {
             this.traceSource.TraceImpl((TraceEventType)TraceEventType.Start, this._stackLevel, this._message, this._args);
         }
     }
 }
Exemple #3
0
 protected MethodTraceBase(TcTraceSource source) : this(source, string.Empty, null)
 {
 }