本文整理汇总了C#中ITraceWriter类的典型用法代码示例。如果您正苦于以下问题:C# ITraceWriter类的具体用法?C# ITraceWriter怎么用?C# ITraceWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITraceWriter类属于命名空间,在下文中一共展示了ITraceWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTracer
public static MediaTypeFormatter CreateTracer(MediaTypeFormatter formatter, ITraceWriter traceWriter, HttpRequestMessage request)
{
// If we have been asked to wrap a tracer around a formatter, it could be
// already wrapped, and there is nothing to do. But if we see it is a tracer
// that is not associated with a request, we wrap it into a new tracer that
// does have a request. The only formatter tracers without requests are the
// ones in the default MediaTypeFormatterCollection in the HttpConfiguration.
IFormatterTracer formatterTracer = formatter as IFormatterTracer;
if (formatterTracer != null)
{
if (formatterTracer.Request == request)
{
return formatter;
}
formatter = formatterTracer.InnerFormatter;
}
MediaTypeFormatter tracer = null;
// We special-case Xml, Json and FormUrlEncoded formatters because we expect to be able
// to find them with IsAssignableFrom in the MediaTypeFormatterCollection.
if (formatter is XmlMediaTypeFormatter)
{
tracer = new XmlMediaTypeFormatterTracer(formatter, traceWriter, request);
}
else if (formatter is JsonMediaTypeFormatter)
{
tracer = new JsonMediaTypeFormatterTracer(formatter, traceWriter, request);
}
else if (formatter is FormUrlEncodedMediaTypeFormatter)
{
tracer = new FormUrlEncodedMediaTypeFormatterTracer(formatter, traceWriter, request);
}
else if (formatter is BufferedMediaTypeFormatter)
{
tracer = new BufferedMediaTypeFormatterTracer(formatter, traceWriter, request);
}
else
{
tracer = new MediaTypeFormatterTracer(formatter, traceWriter, request);
}
// Copy SupportedMediaTypes and MediaTypeMappings because they are publically visible
tracer.SupportedMediaTypes.Clear();
foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes)
{
tracer.SupportedMediaTypes.Add(mediaType);
}
tracer.MediaTypeMappings.Clear();
foreach (MediaTypeMapping mapping in formatter.MediaTypeMappings)
{
tracer.MediaTypeMappings.Add(mapping);
}
return tracer;
}
示例2: GlimpseTraceWriter
public GlimpseTraceWriter(IMessageBroker messageBroker, Func<IExecutionTimer> timerStrategy, ITraceWriter innerTraceWriter)
{
_messageBroker = messageBroker;
_timerStrategy = timerStrategy;
_innerTraceWriter = innerTraceWriter;
_traceMessages = new List<JsonTraceMessage>();
}
示例3: Debug
/// <summary>
/// Initializes the debug component
/// </summary>
/// <param name="performanceMonitorConfig">Component that contains the list of performance counters and default performance counter</param>
public Debug(IDictionary<string, ITraceWriter> traceConfiguration, ITraceWriter defaultWriter)
{
this.traceCollection = traceConfiguration;
this.defaultTrace = defaultWriter;
this.Register(this.traceCollection.Values);
this.Register(this.defaultTrace);
}
示例4: CorsPolicyProviderFactoryTracer
public CorsPolicyProviderFactoryTracer(ICorsPolicyProviderFactory innerPolicyProviderFactory, ITraceWriter traceWriter)
{
Contract.Assert(innerPolicyProviderFactory != null);
Contract.Assert(traceWriter != null);
_innerPolicyProviderFactory = innerPolicyProviderFactory;
_traceWriter = traceWriter;
}
示例5: ActionFilterAttributeTracer
public ActionFilterAttributeTracer(ActionFilterAttribute innerFilter, ITraceWriter traceWriter)
{
Contract.Assert(innerFilter != null);
Contract.Assert(traceWriter != null);
_innerFilter = innerFilter;
_traceWriter = traceWriter;
}
示例6: FilterTracer
public FilterTracer(IFilter innerFilter, ITraceWriter traceWriter)
{
Contract.Assert(innerFilter != null);
Contract.Assert(traceWriter != null);
InnerFilter = innerFilter;
TraceWriter = traceWriter;
}
示例7: CorsPolicyProviderTracer
public CorsPolicyProviderTracer(ICorsPolicyProvider innerPolicyProvider, ITraceWriter traceWriter)
{
Contract.Assert(innerPolicyProvider != null);
Contract.Assert(traceWriter != null);
_innerPolicyProvider = innerPolicyProvider;
_traceWriter = traceWriter;
}
示例8: HttpParameterBindingTracer
public HttpParameterBindingTracer(HttpParameterBinding innerBinding, ITraceWriter traceWriter) : base(innerBinding.Descriptor)
{
Contract.Assert(innerBinding != null);
Contract.Assert(traceWriter != null);
InnerBinding = innerBinding;
TraceWriter = traceWriter;
}
示例9: ContentNegotiatorTracer
public ContentNegotiatorTracer(IContentNegotiator innerNegotiator, ITraceWriter traceWriter)
{
Contract.Assert(innerNegotiator != null);
Contract.Assert(traceWriter != null);
_innerNegotiator = innerNegotiator;
_traceWriter = traceWriter;
}
示例10: HttpControllerSelectorTracer
public HttpControllerSelectorTracer(IHttpControllerSelector innerSelector, ITraceWriter traceWriter)
{
Contract.Assert(innerSelector != null);
Contract.Assert(traceWriter != null);
_innerSelector = innerSelector;
_traceWriter = traceWriter;
}
示例11: CorsEngineTracer
public CorsEngineTracer(ICorsEngine corsEngine, ITraceWriter traceWriter)
{
Contract.Assert(corsEngine != null);
Contract.Assert(traceWriter != null);
_innerCorsEngine = corsEngine;
_traceWriter = traceWriter;
}
示例12: MessageHandlerTracer
public MessageHandlerTracer(DelegatingHandler innerHandler, ITraceWriter traceWriter)
{
Contract.Assert(innerHandler != null);
Contract.Assert(traceWriter != null);
_innerHandler = innerHandler;
_traceWriter = traceWriter;
}
示例13: ActionValueBinderTracer
public ActionValueBinderTracer(IActionValueBinder innerBinder, ITraceWriter traceWriter)
{
Contract.Assert(innerBinder != null);
Contract.Assert(traceWriter != null);
_innerBinder = innerBinder;
_traceWriter = traceWriter;
}
示例14: HttpActionInvokerTracer
public HttpActionInvokerTracer(IHttpActionInvoker innerInvoker, ITraceWriter traceWriter)
{
Contract.Assert(innerInvoker != null);
Contract.Assert(traceWriter != null);
_innerInvoker = innerInvoker;
_traceWriter = traceWriter;
}
示例15: FormatterParameterBindingTracer
public FormatterParameterBindingTracer(FormatterParameterBinding innerBinding, ITraceWriter traceWriter) : base(innerBinding.Descriptor, innerBinding.Formatters, innerBinding.BodyModelValidator)
{
Contract.Assert(innerBinding != null);
Contract.Assert(traceWriter != null);
_innerBinding = innerBinding;
_traceWriter = traceWriter;
}