本文整理汇总了C#中RuntimePipeline.ReplaceHandler方法的典型用法代码示例。如果您正苦于以下问题:C# RuntimePipeline.ReplaceHandler方法的具体用法?C# RuntimePipeline.ReplaceHandler怎么用?C# RuntimePipeline.ReplaceHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuntimePipeline
的用法示例。
在下文中一共展示了RuntimePipeline.ReplaceHandler方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonCognitoSyncException>(this.Logger));
pipeline.RemoveHandler<Amazon.Runtime.Internal.CredentialsRetriever>();
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.CognitoSync.Internal.CognitoCredentialsRetriever(this.Credentials));
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.CognitoSync.Internal.AmazonCognitoSyncPostMarshallHandler());
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Signer>(new Amazon.CognitoSync.Internal.AmazonCognitoSyncPostSignHandler());
}
示例3: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
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());
pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.S3.Internal.AmazonS3ResponseHandler());
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.ErrorCallbackHandler>(new Amazon.S3.Internal.AmazonS3ExceptionHandler());
pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.S3.Internal.AmazonS3RedirectHandler());
pipeline.ReplaceHandler<Amazon.Runtime.Internal.RetryHandler>(new Amazon.Runtime.Internal.RetryHandler(new Amazon.S3.Internal.AmazonS3RetryPolicy(this.Config.MaxErrorRetry)));
}
示例4: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonCognitoIdentityException>(this.Logger));
}
示例5: 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)));
}
示例6: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonMobileAnalyticsException>(this.Logger));
}
示例7: CustomizeRuntimePipeline
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.ReplaceHandler<Amazon.Runtime.Internal.ErrorHandler>(new Amazon.Runtime.Internal.ErrorHandler<AmazonSecurityTokenServiceException>(this.Logger));
}
示例8: 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());
}
示例9: 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());
}
示例10: 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);
}