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

C# IRequestHandler类代码示例

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

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



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

示例1: UrsaHandler

        /// <summary>Initializes a new instance of the <see cref="UrsaHandler"/> class.</summary>
        /// <param name="next">Next middleware in the pipeline.</param>
        /// <param name="requestHandler">The request handler.</param>
        public UrsaHandler(OwinMiddleware next, IRequestHandler<RequestInfo, ResponseInfo> requestHandler) : base(next)
        {
            if (requestHandler == null)
            {
                throw new ArgumentNullException("requestHandler");
            }

            _requestHandler = requestHandler;
        }
开发者ID:alien-mcl,项目名称:URSA,代码行数:12,代码来源:UrsaHandler.cs


示例2: Register

		/// <summary>
		/// Регистрирует хэндлер для определенного адреса
		/// </summary>
		/// <param name="path"></param>
		/// <param name="handler"></param>
		public void Register(string path, IRequestHandler handler)
		{
			lock (this)
			{
				_cache[path] = handler;
			}
		}
开发者ID:Qorpent,项目名称:qorpent.integration,代码行数:12,代码来源:DefaultRequestHandlerFactory.cs


示例3:

 public BoxersController
     (
         IRequestHandler<CreateBoxerRequest, Boxer> createBoxerHandler
     )
 {
     this.createBoxerHandler = createBoxerHandler;
 }
开发者ID:Tsonov,项目名称:FMI.WeAzure.Boxing,代码行数:7,代码来源:BoxersController.cs


示例4: StackClientPlugins

 /// <summary>
 /// Instance a new Stack Client plugin container.
 /// </summary>
 /// <param name="defaults">Defaults values for queries executed against this client.</param>
 /// <param name="handler">A request handler for this client.</param>
 /// <param name="logger">Event log message dispatcher.</param>
 /// <param name="cache">API Response cache store.</param>
 /// <param name="throttler">Request throttler.</param>
 public StackClientPlugins(IDefaults defaults, IRequestHandler handler, IEventLog logger, IResponseCache cache, IRequestThrottler throttler)
 {
     if (defaults == null)
     {
         throw new ArgumentNullException("defaults");
     }
     if (handler == null)
     {
         throw new ArgumentNullException("handler");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     if (cache == null)
     {
         throw new ArgumentNullException("cache");
     }
     if (throttler == null)
     {
         throw new ArgumentNullException("throttler");
     }
     Default = defaults;
     RequestHandler = handler;
     EventLog = logger;
     Cache = cache;
     Throttler = throttler;
 }
开发者ID:bevacqua,项目名称:BridgeStack,代码行数:36,代码来源:StackClientPlugins.cs


示例5: HmRpcServer

        public HmRpcServer(IRequestHandler requestHandler)
        {
            _requestHandler = new LoggingMessageHandler(new BufferedMessageHandler(requestHandler));

            _listener = new TcpListener(IPAddress.Any, 6300);
            _listener.Server.ReceiveTimeout = 3000 * 10;
        }
开发者ID:flwn,项目名称:HmLib,代码行数:7,代码来源:HmRpcServer.cs


示例6: NanoHttpServer

 public NanoHttpServer(int port)
 {
     _handlers = new Dictionary<string, IRequestHandler>();
     _tcp = new TcpServer(port);
     _tcp.ConnectionAdded += OnConnectionAdded;
     _root = new StubHandler("Page not ready yet".ToNoStyleHtmlBody());
 }
开发者ID:Bit-notes,项目名称:nanoboard,代码行数:7,代码来源:NanoHttpServer.cs


示例7: AccountService

 public AccountService(IRequestHandler<WithdrawRequest, WithdrawResponse> wRequestHandler, 
     IRequestHandler<CheckBalanceRequest, CheckBalanceResponse> cRequestHandler 
     )
 {
     _wRequestHandler = wRequestHandler;
     _cRequestHandler = cRequestHandler;
 }
开发者ID:eatskolnikov,项目名称:QBank,代码行数:7,代码来源:AccountService.cs


示例8: ChannelsApi

        public ChannelsApi(IRequestHandler requestHandler)
        {
            if (requestHandler == null)
                throw new ArgumentNullException(nameof(requestHandler));

            this.request = requestHandler;
        }
开发者ID:vampireneo,项目名称:slack,代码行数:7,代码来源:ChannelsApi.cs


示例9: BlockingFlushHandler

		internal BlockingFlushHandler(IBatchFactory batchFactory, 
		                         IRequestHandler requestHandler)
		{

			this._batchFactory = batchFactory;
			this._requestHandler = requestHandler;
		}
开发者ID:hatton,项目名称:Analytics.NET,代码行数:7,代码来源:BlockingFlushHandler.cs


示例10: ProcessingContext

        /// <summary>
        /// Initializes a new instance of the <see cref="ProcessingContext"/> class.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <param name="handler">The handler.</param>
        public ProcessingContext(IRequest request, IRequestHandler handler)
        {
            Contract.Requires(request != null);
            Contract.Requires(handler != null);

            this.Request = request;
            this.Handler = handler;
        }
开发者ID:movileanubeniamin,项目名称:kephas,代码行数:13,代码来源:ProcessingContext.cs


示例11: JsonScraper

        public JsonScraper(IRequestHandler requestHandler, ScrapeConfig scrapeConfig = null)
        {
            Log = LogManager.GetCurrentClassLogger();//todo: inject this in?
            _requestHandler = requestHandler;
            _scrapeConfig = scrapeConfig;

            _stopwatch = new Stopwatch();
        }
开发者ID:unibirmingham,项目名称:TalisScrape,代码行数:8,代码来源:JsonScraper.cs


示例12: AbstractRestClient

 /// <summary>
 /// </summary>
 /// <param name="baseUrl"></param>
 /// <param name="requestHandler"></param>
 /// <param name="requestLogger"></param>
 protected AbstractRestClient(string baseUrl, IRequestHandler requestHandler, IRequestLogger requestLogger)
 {
     RequestLogger = requestLogger;
     RequestHandler = requestHandler;
     BaseUrl = baseUrl;
     RequestHeaders = new Dictionary<string, string>();
     ConnectionTimeout = 2000; //Default 2s, deliberately short.
     ReadWriteTimeout = 8000; // Default 8s, reasonably short if accidentally called from the UI thread
 }
开发者ID:enokby,项目名称:smsghapi-csharp,代码行数:14,代码来源:AbstractRestClient.cs


示例13: TcpHostConnection

		private TcpHostConnection(TcpHost tcpHost, NetworkStream stream, IRequestHandler engine):base(stream)
		{
			if (tcpHost == null) throw new ArgumentNullException("tcpHost");
			if (stream == null) throw new ArgumentNullException("stream");
			if (engine == null) throw new ArgumentNullException("engine");
			_tcpHost = tcpHost;
			_stream = stream;
			_engine = engine;
		}
开发者ID:kekekeks,项目名称:AsyncRpc,代码行数:9,代码来源:TcpHostConnection.cs


示例14: HttpServer

        public HttpServer(string prefix, int port, IRequestHandler[] handlers)
        {
            this.handlers = handlers ?? new IRequestHandler[0];

            listener = new HttpListener(prefix, port);
            listener.Start();

            var pool = new ThreadPool(defaultPoolSize, ProcessRequest);
        }
开发者ID:ducas,项目名称:MicroWebServer,代码行数:9,代码来源:HttpServer.cs


示例15: SetupHierarchyType

        /// <summary>
        /// Get hierarchy type from query string of current http request and save "HierarchyType" into TempVariables of IApplicationContext.
        /// </summary>
        /// <param name="requestHandler">Request handler.</param>
        /// <param name="e"></param>
        /// <param name="rediectToPageNotFoundUrlIfHierarchyTypeNotFound"></param>
        public static void SetupHierarchyType(IRequestHandler requestHandler, SetupApplicationContextVariablesEventArgs e, bool rediectToPageNotFoundUrlIfHierarchyTypeNotFound)
        {
            IPlatformConfiguration platformConfiguration = SpringContext.Current.GetObject<IPlatformConfiguration>();
            string hierarchyType = requestHandler.Parameters["HierarchyType"];
            if (string.IsNullOrEmpty(hierarchyType) && rediectToPageNotFoundUrlIfHierarchyTypeNotFound)
                throw new ResourceNotFoundException(string.Format(CultureInfo.InvariantCulture, Resources.InvalidHierarchyType, hierarchyType));

            e.TempVariables["HierarchyType"] = hierarchyType;
        }
开发者ID:TatumAndBell,项目名称:RapidWebDev-Enterprise-CMS,代码行数:15,代码来源:SetupContextTempVariablesUtility.cs


示例16: SetupConcreteDataType

        /// <summary>
        /// Get concrete data type from query string of current http request and save "ConcreteDataCategory" into TempVariables of IApplicationContext.
        /// </summary>
        /// <param name="requestHandler">Request handler.</param>
        /// <param name="e"></param>
        /// <param name="rediectToPageNotFoundUrlIfCategoryNotFound"></param>
        public static void SetupConcreteDataType(IRequestHandler requestHandler, SetupApplicationContextVariablesEventArgs e, bool rediectToPageNotFoundUrlIfCategoryNotFound)
        {
            string concreteDataType = requestHandler.Parameters["ConcreteDataType"];
            if (string.IsNullOrEmpty(concreteDataType) && rediectToPageNotFoundUrlIfCategoryNotFound)
                throw new ResourceNotFoundException(string.Format(CultureInfo.InvariantCulture, Resources.InvalidConcreteDataType, concreteDataType));

            if (!string.IsNullOrEmpty(concreteDataType))
                e.TempVariables["ConcreteDataType"] = concreteDataType;
        }
开发者ID:TatumAndBell,项目名称:RapidWebDev-Enterprise-CMS,代码行数:15,代码来源:SetupContextTempVariablesUtility.cs


示例17:

 public LoginsController
     (
         IRequestHandler<LoginRequest, string> loginHandler,
         ICommandHandler<LogoutRequest> logoutHandler
     )
 {
     this.loginHandler = loginHandler;
     this.logoutHandler = logoutHandler;
 }
开发者ID:Tsonov,项目名称:FMI.WeAzure.Boxing,代码行数:9,代码来源:LoginsController.cs


示例18: SetupContextTempVariables

        /// <summary>
        /// Validate query string "MetadataDataTypeName" and setup metadata data type name to IAuthenticationContext.TempVariables.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void SetupContextTempVariables(IRequestHandler sender, SetupApplicationContextVariablesEventArgs e)
        {
            string metadataDataTypeName = QueryStringUtility.MetadataDataTypeName(sender);
            IObjectMetadata metadata = metadataApi.GetType(metadataDataTypeName);
            if (metadata == null)
                throw new ResourceNotFoundException(string.Format(CultureInfo.InvariantCulture, Resources.InvalidMetadataTypeName, metadataDataTypeName));

            e.TempVariables["MetadataDataTypeId"] = metadata.Id;
            e.TempVariables["MetadataDataTypeName"] = metadata.Name;
        }
开发者ID:TatumAndBell,项目名称:RapidWebDev-Enterprise-CMS,代码行数:15,代码来源:ExtensionFieldMetadataAggregatePanel.cs


示例19: MatchPath

 private static bool MatchPath(IRequestHandler requestHandler, HttpRequestHead request)
 {
     var pathToMatch = request.Uri;
     int positionOfQueryStart = GetStartOfQueryString(request.Uri);
     if (positionOfQueryStart > -1)
     {
         pathToMatch = request.Uri.Substring(0, positionOfQueryStart);
     }
     var pathMatch = new Regex(string.Format(@"^{0}\/*$", requestHandler.Path));
     return pathMatch.IsMatch(pathToMatch);
 }
开发者ID:nicklbailey,项目名称:HttpMock,代码行数:11,代码来源:EndpointMatchingRule.cs


示例20: SessionContext

 public SessionContext(string sessionId, IRequestHandler requestHandler, IRegistrator<string, ISessionContext> publisherRegistrator)
 {
     this.publisherRegistrator = publisherRegistrator;
     SessionId = sessionId;
     RequestHandler = requestHandler;
     sessionStateEngine = SessionStateEngineFactory.Create(this);
     SessionTimeoutContext = new ElapsedTimerContext(SessionTimerConstants.SESSION_TIME_OUT);
     ResponseTimeoutContext = new ElapsedTimerContext(SessionTimerConstants.RESPONSE_TIME_OUT);
     sessionElapsedTimer = new SessionElaspedTimer(sessionStateEngine, this);
     UnRegister();
 }
开发者ID:pingmeaschandru,项目名称:LiveMeeting,代码行数:11,代码来源:SessionContext.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IRequestHandlerContext类代码示例发布时间:2022-05-24
下一篇:
C# IRequestFactory类代码示例发布时间: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