Esempio n. 1
0
 internal IDisposable TraceEventHandlers(string format, params object[] args)
 {
     if ((this.flags & PSTraceSourceOptions.Events) != PSTraceSourceOptions.None)
     {
         try
         {
             return((IDisposable) new ScopeTracer(this, PSTraceSourceOptions.Events, "Enter event handler: {0}:", "Leave event handler: {0}", PSTraceSource.GetCallingMethodNameAndParameters(1), format, args));
         }
         catch
         {
         }
     }
     return((IDisposable)null);
 }
Esempio n. 2
0
 internal IDisposable TraceDelegateHandler()
 {
     if ((this.flags & PSTraceSourceOptions.Delegates) != PSTraceSourceOptions.None)
     {
         try
         {
             return((IDisposable) new ScopeTracer(this, PSTraceSourceOptions.Delegates, "Enter delegate handler: {0}:", "Leave delegate handler: {0}", PSTraceSource.GetCallingMethodNameAndParameters(1), "", new object[0]));
         }
         catch
         {
         }
     }
     return((IDisposable)null);
 }
Esempio n. 3
0
 internal IDisposable TraceProperty(string format, params object[] args)
 {
     if ((this.flags & PSTraceSourceOptions.Property) != PSTraceSourceOptions.None)
     {
         try
         {
             return((IDisposable) new ScopeTracer(this, PSTraceSourceOptions.Property, "Enter property {0}:", "Leave property {0}", PSTraceSource.GetCallingMethodNameAndParameters(1), format, args));
         }
         catch
         {
         }
     }
     return((IDisposable)null);
 }
Esempio n. 4
0
 internal IDisposable TraceProperty(object o)
 {
     if ((this.flags & PSTraceSourceOptions.Property) != PSTraceSourceOptions.None)
     {
         try
         {
             return((IDisposable) new ScopeTracer(this, PSTraceSourceOptions.Property, "Enter property {0}:", "Leave property {0}", PSTraceSource.GetCallingMethodNameAndParameters(1), string.Format((IFormatProvider)Thread.CurrentThread.CurrentCulture, "{0}", o == null ? (object)"null" : (object)o.ToString()), new object[0]));
         }
         catch
         {
         }
     }
     return((IDisposable)null);
 }
Esempio n. 5
0
 internal IDisposable TraceMethod()
 {
     if ((this.flags & PSTraceSourceOptions.Method) != PSTraceSourceOptions.None)
     {
         try
         {
             return((IDisposable) new ScopeTracer(this, PSTraceSourceOptions.Method, "Enter {0}:", "Leave {0}", PSTraceSource.GetCallingMethodNameAndParameters(1)));
         }
         catch
         {
         }
     }
     return((IDisposable)null);
 }