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

C# RuntimePipeline类代码示例

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

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



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

示例1: CustomizeRuntimePipeline

        protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
        {
            _requestFactory = new AWSSDK.UnitTests.HttpHandlerTests.MockHttpRequestFactory();
            var httpHandler = new HttpHandler<Stream>(_requestFactory, this);

            pipeline.ReplaceHandler<HttpHandler<Stream>>(httpHandler);
        }
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:7,代码来源:AmazonServiceClientTests.cs


示例2: AddHandlerTest

        public void AddHandlerTest()
        {
            var handlerA = new TestHandlerA();
            var pipeline = new RuntimePipeline(handlerA);
            var handlerB = new TestHandlerB();
            // B->A
            pipeline.AddHandler(handlerB);

            ValidatePipeline(pipeline, handlerB, handlerA);
        }
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:10,代码来源:RuntimePipelineTests.cs


示例3: TestSignerWithBasicCredentialsAsync

        public async Task TestSignerWithBasicCredentialsAsync()
        {
            var pipeline = new RuntimePipeline(new MockHandler());            
            pipeline.AddHandler(new Signer());
            pipeline.AddHandler(new CredentialsRetriever(new BasicAWSCredentials("accessKey", "secretKey")));

            var context = CreateTestContext();
            var signer = new MockSigner();
            ((RequestContext)context.RequestContext).Signer = signer;
            await pipeline.InvokeAsync<AmazonWebServiceResponse>(context);

            Assert.IsTrue(context.RequestContext.IsSigned);
            Assert.AreEqual(1, signer.SignCount);
        }
开发者ID:nataren,项目名称:aws-sdk-net,代码行数:14,代码来源:SignerTests.cs


示例4: TestSignerWithAnonymousCredentials

        public void TestSignerWithAnonymousCredentials()
        {            
            var pipeline = new RuntimePipeline(new MockHandler());
            pipeline.AddHandler(new Signer());
            pipeline.AddHandler(new CredentialsRetriever(new AnonymousAWSCredentials()));

            var context = CreateTestContext();
            var signer = new MockSigner();
            ((RequestContext)context.RequestContext).Signer = signer;
            pipeline.InvokeSync(context);

            Assert.IsTrue(context.RequestContext.IsSigned);
            Assert.AreEqual(0, signer.SignCount);
        }
开发者ID:nataren,项目名称:aws-sdk-net,代码行数:14,代码来源:SignerTests.cs


示例5: TestSignerWithBasicCredentials

        public void TestSignerWithBasicCredentials()
        {
            var pipeline = new RuntimePipeline(new MockHandler());            
            pipeline.AddHandler(new Signer());
            pipeline.AddHandler(new CredentialsRetriever(new BasicAWSCredentials("accessKey", "secretKey")));

            var context = CreateTestContext();
            var signer = new MockSigner();
            ((RequestContext)context.RequestContext).Signer = signer;
            pipeline.InvokeSync(context);

            Assert.IsTrue(context.RequestContext.IsSigned);
            Assert.AreEqual(1, signer.SignCount);
        }
开发者ID:nataren,项目名称:aws-sdk-net,代码行数:14,代码来源:SignerTests.cs


示例6: AddHandlerBeforeTest

        public void AddHandlerBeforeTest()
        {
            var handlerD = new TestHandlerD();
            var pipeline = new RuntimePipeline(handlerD);
            var handlerB = new TestHandlerB();
            // B->D
            pipeline.AddHandler(handlerB);
            var handlerA = new TestHandlerA();
            // A->B->D
            pipeline.AddHandlerBefore<TestHandlerB>(handlerA);
            ValidatePipeline(pipeline, handlerA, handlerB, handlerD);

            var handlerC = new TestHandlerC();
            // A->B->C->D
            pipeline.AddHandlerBefore<TestHandlerD>(handlerC);
            ValidatePipeline(pipeline, handlerA, handlerB, handlerC, handlerD);            
        }
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:17,代码来源:RuntimePipelineTests.cs


示例7: ReplaceHandlerTest

        public void ReplaceHandlerTest()
        {
            var handlerC = new TestHandlerC();
            var pipeline = new RuntimePipeline(handlerC);
            var handlerB = new TestHandlerB();            
            pipeline.AddHandler(handlerB);
            var handlerA = new TestHandlerA();
            //A->B->C
            pipeline.AddHandler(handlerA);
            ValidatePipeline(pipeline, handlerA, handlerB, handlerC);

            var handlerD = new TestHandlerD();
            //A->D->C
            pipeline.ReplaceHandler<TestHandlerB>(handlerD);
            ValidatePipeline(pipeline, handlerA, handlerD, handlerC);
            Assert.IsNull(handlerB.OuterHandler);
            Assert.IsNull(handlerB.InnerHandler);
        }
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:18,代码来源:RuntimePipelineTests.cs


示例8: TestSignerWithMutableHeader

        public void TestSignerWithMutableHeader()
        {
            var pipeline = new RuntimePipeline(new MockHandler());           
            pipeline.AddHandler(new Signer());
            pipeline.AddHandler(new CredentialsRetriever(new BasicAWSCredentials("accessKey", "secretKey")));

            var context = CreateTestContext();
            var signer = new AWS4Signer();
            ((RequestContext)context.RequestContext).Signer = signer;

            // inject a mutable header that the signer should strip out
            context.RequestContext.Request.Headers[HeaderKeys.XAmznTraceIdHeader] = "stuff";
            pipeline.InvokeSync(context);

            // verify that the header is not in the signature
            var t = context.RequestContext.Request.Headers[HeaderKeys.AuthorizationHeader];
            Assert.IsFalse(t.Contains(HeaderKeys.XAmznTraceIdHeader));

            Assert.IsTrue(context.RequestContext.Request.Headers.ContainsKey(HeaderKeys.XAmznTraceIdHeader));
        }
开发者ID:aws,项目名称:aws-sdk-net,代码行数:20,代码来源:SignerTests.cs


示例9: CustomizeRuntimePipeline

 /// <summary>
 /// Customizes the runtime pipeline.
 /// </summary>
 /// <param name="pipeline">Runtime pipeline for the current client.</param>
 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.MachineLearning.Internal.ProcessRequestHandler());
     pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.MachineLearning.Internal.IdempotencyHandler());
 }
开发者ID:reidwooten99apps,项目名称:aws-sdk-net,代码行数:9,代码来源:AmazonMachineLearningClient.cs


示例10: CustomizeRuntimePipeline

 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.ElasticFileSystem.Internal.IdempotencyHandler());
 }
开发者ID:JonathanHenson,项目名称:aws-sdk-net,代码行数:4,代码来源:AmazonElasticFileSystemClient.cs


示例11: CustomizeRuntimePipeline

 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonMobileAnalyticsException>(this.Logger));
 }    
开发者ID:NathanSDunn,项目名称:aws-sdk-unity-samples,代码行数:4,代码来源:AmazonMobileAnalyticsClient.cs


示例12: CustomizeRuntimePipeline

 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonSecurityTokenServiceException>(this.Logger));
 }    
开发者ID:NathanSDunn,项目名称:aws-sdk-unity-samples,代码行数:4,代码来源:AmazonSecurityTokenServiceClient.cs


示例13: CustomizeRuntimePipeline

 /// <summary>
 /// Customize the pipeline
 /// </summary>
 /// <param name="pipeline"></param>
 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.RDS.Internal.PreSignedUrlRequestHandler(this.Credentials));
 }    
开发者ID:aws,项目名称:aws-sdk-net,代码行数:8,代码来源:AmazonRDSClient.cs


示例14: CustomizeRuntimePipeline

 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.CloudSearchDomain.Internal.ProcessRequestHandler());
     pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.CloudSearchDomain.Internal.ValidationResponseHandler());
     pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.CloudSearchDomain.Internal.ProcessExceptionHandler());
 }    
开发者ID:wmatveyenko,项目名称:aws-sdk-net,代码行数:6,代码来源:AmazonCloudSearchDomainClient.cs


示例15: CustomizeRuntimePipeline

 /// <summary>
 /// Customizes the runtime pipeline.
 /// </summary>
 /// <param name="pipeline">Runtime pipeline for the current client.</param>
 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.CloudFormation.Internal.ProcessRequestHandler());
 }
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:8,代码来源:AmazonCloudFormationClient.cs


示例16: CustomizeRuntimePipeline

 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.ReplaceHandler<Amazon.Runtime.Internal.RetryHandler>(new Amazon.Runtime.Internal.RetryHandler(new Amazon.DynamoDBv2.Internal.DynamoDBRetryPolicy(this.Config.MaxErrorRetry)));
 }
开发者ID:sadiqj,项目名称:aws-sdk-xamarin,代码行数:4,代码来源:_AmazonDynamoDBClient.cs


示例17: ValidatePipeline

 void ValidatePipeline(RuntimePipeline pipeline,params IPipelineHandler[] handlers)
 {
     Assert.AreEqual(pipeline.Handler, handlers[0]);
     for (int index = 0; index < handlers.Length; index++)
     {
         if (index>0)
         {
             Assert.AreEqual(handlers[index - 1], handlers[index].OuterHandler);
         }
         if (index < handlers.Length - 1)
         {
             Assert.AreEqual(handlers[index + 1], handlers[index].InnerHandler);
         }
     }
 }
开发者ID:rajdotnet,项目名称:aws-sdk-net,代码行数:15,代码来源:RuntimePipelineTests.cs


示例18: CustomizeRuntimePipeline

 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonSQSException>(this.Logger));
     pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.SQS.Internal.ProcessRequestHandler());
     pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.SQS.Internal.ValidationResponseHandler());
 }    
开发者ID:NathanSDunn,项目名称:aws-sdk-unity,代码行数:6,代码来源:AmazonSQSClient.cs


示例19: CustomizeRuntimePipeline

 protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
 {
     pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonS3Exception>(this.Logger));
     pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.S3.Internal.AmazonS3PreMarshallHandler());
     pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.S3.Internal.AmazonS3PostMarshallHandler());
     pipeline.AddHandlerAfter<Amazon.Runtime.Internal.EndpointResolver>(new Amazon.S3.Internal.AmazonS3KmsHandler());
 }    
开发者ID:johnryork,项目名称:aws-sdk-unity,代码行数:7,代码来源:AmazonS3Client.cs


示例20: CustomizeRuntimePipeline

        protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
        {
            base.CustomizeRuntimePipeline(pipeline);

            pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.S3.Encryption.Internal.SetupEncryptionHandler(this));
            pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.S3.Encryption.Internal.UserAgentHandler());
            pipeline.AddHandlerBefore<Amazon.S3.Internal.AmazonS3ResponseHandler>(new Amazon.S3.Encryption.Internal.SetupDecryptionHandler(this));
        }  
开发者ID:wmatveyenko,项目名称:aws-sdk-net,代码行数:8,代码来源:AmazonS3EncryptionClient.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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