• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ITraceWriter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ITraceWriter的典型用法代码示例。如果您正苦于以下问题:C# ITraceWriter类的具体用法?C# ITraceWriter怎么用?C# ITraceWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITraceWriter类属于命名空间,在下文中一共展示了ITraceWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: BufferedMediaTypeFormatterTracer

        public BufferedMediaTypeFormatterTracer(BufferedMediaTypeFormatter innerFormatter, ITraceWriter traceWriter, HttpRequestMessage request)
        {
            _innerTracer = new MediaTypeFormatterTracer(innerFormatter, traceWriter, request);

            // copy non-overridable members from inner formatter
            _innerTracer.CopyNonOverriableMembersFromInner(this);
            BufferSize = innerFormatter.BufferSize;
        }
开发者ID:reza899,项目名称:aspnetwebstack,代码行数:8,代码来源:BufferedMediaTypeFormatterTracer.cs


示例17: AuthorizationFilterAttributeTracer

        public AuthorizationFilterAttributeTracer(AuthorizationFilterAttribute innerFilter, ITraceWriter traceWriter)
        {
            Contract.Assert(innerFilter != null);
            Contract.Assert(traceWriter != null);

            _innerFilter = innerFilter;
            _traceStore = traceWriter;
        }
开发者ID:marojeri,项目名称:aspnetwebstack,代码行数:8,代码来源:AuthorizationFilterAttributeTracer.cs


示例18: GetHttpControllerDescriptorTracer

 private static HttpControllerDescriptorTracer GetHttpControllerDescriptorTracer(HttpControllerDescriptor controllerDescriptor, ITraceWriter traceWriter)
 {
     return new HttpControllerDescriptorTracer(
         configuration: new HttpConfiguration(),
         controllerName: "AnyController",
         controllerType: _controller.GetType(),
         innerDescriptor: controllerDescriptor,
         traceWriter: traceWriter);
 }
开发者ID:reza899,项目名称:aspnetwebstack,代码行数:9,代码来源:HttpControllerDescriptorTracerTest.cs


示例19: FormUrlEncodedMediaTypeFormatterTracer

        public FormUrlEncodedMediaTypeFormatterTracer(FormUrlEncodedMediaTypeFormatter innerFormatter, ITraceWriter traceWriter, HttpRequestMessage request)
        {
            _innerTracer = new MediaTypeFormatterTracer(innerFormatter, traceWriter, request);

            // copy non-overridable members from inner formatter
            _innerTracer.CopyNonOverriableMembersFromInner(this);
            MaxDepth = innerFormatter.MaxDepth;
            ReadBufferSize = innerFormatter.ReadBufferSize;
        }
开发者ID:marojeri,项目名称:aspnetwebstack,代码行数:9,代码来源:FormUrlEncodedMediaTypeFormatterTracer.cs


示例20: HttpControllerTracer

        public HttpControllerTracer(HttpRequestMessage request, IHttpController innerController, ITraceWriter traceWriter)
        {
            Contract.Assert(innerController != null);
            Contract.Assert(traceWriter != null);

            _innerController = innerController;
            _request = request;
            _traceWriter = traceWriter;
        }
开发者ID:chrissimon-au,项目名称:aspnetwebstack,代码行数:9,代码来源:HttpControllerTracer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITracer类代码示例发布时间:2022-05-24
下一篇:
C# ITraceManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap