当前位置: 首页>>代码示例>>C#>>正文


C# ITraceWriter类代码示例

本文整理汇总了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;
        }
开发者ID:haoduotnt,项目名称:aspnetwebstack,代码行数:58,代码来源:MediaTypeFormatterTracer.cs

示例2: GlimpseTraceWriter

 public GlimpseTraceWriter(IMessageBroker messageBroker, Func<IExecutionTimer> timerStrategy, ITraceWriter innerTraceWriter)
 {
   _messageBroker = messageBroker;
   _timerStrategy = timerStrategy;
   _innerTraceWriter = innerTraceWriter;
   _traceMessages = new List<JsonTraceMessage>();
 }
开发者ID:modulexcite,项目名称:Newtonsoft.Json.Glimpse,代码行数:7,代码来源:GlimpseTraceWriter.cs

示例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);
 }
开发者ID:krishnarajv,项目名称:Code,代码行数:11,代码来源:Debug.cs

示例4: CorsPolicyProviderFactoryTracer

        public CorsPolicyProviderFactoryTracer(ICorsPolicyProviderFactory innerPolicyProviderFactory, ITraceWriter traceWriter)
        {
            Contract.Assert(innerPolicyProviderFactory != null);
            Contract.Assert(traceWriter != null);

            _innerPolicyProviderFactory = innerPolicyProviderFactory;
            _traceWriter = traceWriter;
        }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:8,代码来源:CorsPolicyProviderFactoryTracer.cs

示例5: ActionFilterAttributeTracer

        public ActionFilterAttributeTracer(ActionFilterAttribute innerFilter, ITraceWriter traceWriter)
        {
            Contract.Assert(innerFilter != null);
            Contract.Assert(traceWriter != null);

            _innerFilter = innerFilter;
            _traceWriter = traceWriter;
        }
开发者ID:chrissimon-au,项目名称:aspnetwebstack,代码行数:8,代码来源:ActionFilterAttributeTracer.cs

示例6: FilterTracer

        public FilterTracer(IFilter innerFilter, ITraceWriter traceWriter)
        {
            Contract.Assert(innerFilter != null);
            Contract.Assert(traceWriter != null);

            InnerFilter = innerFilter;
            TraceWriter = traceWriter;
        }
开发者ID:reza899,项目名称:aspnetwebstack,代码行数:8,代码来源:FilterTracer.cs

示例7: CorsPolicyProviderTracer

        public CorsPolicyProviderTracer(ICorsPolicyProvider innerPolicyProvider, ITraceWriter traceWriter)
        {
            Contract.Assert(innerPolicyProvider != null);
            Contract.Assert(traceWriter != null);

            _innerPolicyProvider = innerPolicyProvider;
            _traceWriter = traceWriter;
        }
开发者ID:brianly,项目名称:aspnetwebstack,代码行数:8,代码来源:CorsPolicyProviderTracer.cs

示例8: HttpParameterBindingTracer

        public HttpParameterBindingTracer(HttpParameterBinding innerBinding, ITraceWriter traceWriter) : base(innerBinding.Descriptor)
        {
            Contract.Assert(innerBinding != null);
            Contract.Assert(traceWriter != null);

            InnerBinding = innerBinding;
            TraceWriter = traceWriter;
        }
开发者ID:reza899,项目名称:aspnetwebstack,代码行数:8,代码来源:HttpParameterBindingTracer.cs

示例9: ContentNegotiatorTracer

        public ContentNegotiatorTracer(IContentNegotiator innerNegotiator, ITraceWriter traceWriter)
        {
            Contract.Assert(innerNegotiator != null);
            Contract.Assert(traceWriter != null);

            _innerNegotiator = innerNegotiator;
            _traceWriter = traceWriter;
        }
开发者ID:reza899,项目名称:aspnetwebstack,代码行数:8,代码来源:ContentNegotiatorTracer.cs

示例10: HttpControllerSelectorTracer

        public HttpControllerSelectorTracer(IHttpControllerSelector innerSelector, ITraceWriter traceWriter)
        {
            Contract.Assert(innerSelector != null);
            Contract.Assert(traceWriter != null);

            _innerSelector = innerSelector;
            _traceWriter = traceWriter;
        }
开发者ID:reza899,项目名称:aspnetwebstack,代码行数:8,代码来源:HttpControllerSelectorTracer.cs

示例11: CorsEngineTracer

        public CorsEngineTracer(ICorsEngine corsEngine, ITraceWriter traceWriter)
        {
            Contract.Assert(corsEngine != null);
            Contract.Assert(traceWriter != null);

            _innerCorsEngine = corsEngine;
            _traceWriter = traceWriter;
        }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:8,代码来源:CorsEngineTracer.cs

示例12: MessageHandlerTracer

        public MessageHandlerTracer(DelegatingHandler innerHandler, ITraceWriter traceWriter)
        {
            Contract.Assert(innerHandler != null);
            Contract.Assert(traceWriter != null);

            _innerHandler = innerHandler;
            _traceWriter = traceWriter;
        }
开发者ID:chrissimon-au,项目名称:aspnetwebstack,代码行数:8,代码来源:MessageHandlerTracer.cs

示例13: ActionValueBinderTracer

        public ActionValueBinderTracer(IActionValueBinder innerBinder, ITraceWriter traceWriter)
        {
            Contract.Assert(innerBinder != null);
            Contract.Assert(traceWriter != null);

            _innerBinder = innerBinder;
            _traceWriter = traceWriter;
        }
开发者ID:chrissimon-au,项目名称:aspnetwebstack,代码行数:8,代码来源:ActionValueBinderTracer.cs

示例14: HttpActionInvokerTracer

        public HttpActionInvokerTracer(IHttpActionInvoker innerInvoker, ITraceWriter traceWriter)
        {
            Contract.Assert(innerInvoker != null);
            Contract.Assert(traceWriter != null);

            _innerInvoker = innerInvoker;
            _traceWriter = traceWriter;
        }
开发者ID:chrissimon-au,项目名称:aspnetwebstack,代码行数:8,代码来源:HttpActionInvokerTracer.cs

示例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;
        }
开发者ID:marojeri,项目名称:aspnetwebstack,代码行数:8,代码来源:FormatterParameterBindingTracer.cs


注:本文中的ITraceWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。