Impact Vision SDK  11.8.1
VisionSDK.Afterward Class Reference

This static class is used as an easy way to create completion handlers. More...

Static Public Member Functions

static Action< OperationResult > IfSuccessIfFailure (Action successHandler, Action< OperationResult > failureHandler)
 Create a completion handler with the format of : Action<OperationResult> that automatically checks if the operationResult is success or not.
If the operationResult is success, it will execute the success handler, otherwise it will execute the failure handler with OperationResult as the input.
More...
 
static Action< OperationResult< T > > IfSuccessIfFailure< T > (Action< T > successHandler, Action< OperationResult< T >> failureHandler)
 Create a completion handler with the format of : Action<OperationResult<T>> that automatically checks if the operationResult is success or not.
If operationResult is success, it will execute the success handler, otherwise it will execute the failure handler with OperationResult as the input.
More...
 
static Action< OperationResult > IfSuccess (Action successHandler)
 Create a completion handler with the format of : Action<OperationResult> that automatically checks if the operationResult is success or not.
If the operation Result is success, it will execute the success handler, otherwise it will do nothing.
More...
 
static Action< OperationResult< T > > IfSuccess< T > (Action< T > successHandler)
 Create a completion handler with the format of : Action<OperationResult<T>> that automatically checks if the operationResult is success or not.
If the operationResult is not success, it will execute the success handler, otherwise it will do nothing.
More...
 
static Action< OperationResult > IfFailure (Action< OperationResult > failureHandler)
 Create a completion handler with the format of : Action<OperationResult> that automatically checks if the operationResult is success or not.
If the operationResult is not success, it will execute the failure handler, otherwise it will do nothing.
More...
 
static Action< OperationResult< T > > IfFailure< T > (Action< OperationResult< T >> failureHandler)
 Create a completion handler with the format of : Action<OperationResult<T>> that automatically checks if the operationResult is success or not.
If the operationResult is not success, it will execute the failure handler, otherwise it will do nothing.
More...
 
static Action< OperationResult > DoNothing ()
 Create a completion handler with the format of : Action<OperationResult> that does not perform anything.
More...
 
static Action< OperationResult< T > > DoNothing< T > ()
 Create a completion handler with the format of : Action<OperationResult<T> that does not perform anything.
More...
 

Detailed Description

This static class is used as an easy way to create completion handlers.

Member Function Documentation

static Action<OperationResult> VisionSDK.Afterward.DoNothing ( )
static

Create a completion handler with the format of : Action<OperationResult> that does not perform anything.

Returns
The Action<OperationResult> Completion Handler
CompletionHandlerFactory.VoidHandler();
static Action<OperationResult<T> > VisionSDK.Afterward.DoNothing< T > ( )
static

Create a completion handler with the format of : Action<OperationResult<T> that does not perform anything.

Returns
The Action<OperationResult<T>> Completion Handler
CompletionHandlerFactoryVoidHandler<int>();
static Action<OperationResult> VisionSDK.Afterward.IfFailure ( Action< OperationResult >  failureHandler)
static

Create a completion handler with the format of : Action<OperationResult> that automatically checks if the operationResult is success or not.
If the operationResult is not success, it will execute the failure handler, otherwise it will do nothing.

Parameters
failureHandlerThe Handler, with the OperationResult as a parameter, that will be executed in case of failure.
Returns
The Action<OperationResult> Completion Handler
CompletionHandlerFactory.Failure( (visionOperationResult) => { Console.WriteLine("Failure" + visionOperation); });
static Action<OperationResult<T> > VisionSDK.Afterward.IfFailure< T > ( Action< OperationResult< T >>  failureHandler)
static

Create a completion handler with the format of : Action<OperationResult<T>> that automatically checks if the operationResult is success or not.
If the operationResult is not success, it will execute the failure handler, otherwise it will do nothing.

Parameters
failureHandlerThe Handler, with the OperationResult as a parameter, that will be execute in case of failure.
Returns
The Action<OperationResult<T>> Completion Handler
CompletionHandlerFactory.SuccessFailure<int>( (visionOperationResult) => { Console.WriteLine("Failure" + visionOperationResult.Message); });
static Action<OperationResult> VisionSDK.Afterward.IfSuccess ( Action  successHandler)
static

Create a completion handler with the format of : Action<OperationResult> that automatically checks if the operationResult is success or not.
If the operation Result is success, it will execute the success handler, otherwise it will do nothing.

Parameters
successHandlerThe Handler, with no parameter, that will be executed in case of success
Returns
The Action<OperationResult> Completion Handler
CompletionHandlerFactory.Success( () => { Console.WriteLine("Success"); });
static Action<OperationResult<T> > VisionSDK.Afterward.IfSuccess< T > ( Action< T >  successHandler)
static

Create a completion handler with the format of : Action<OperationResult<T>> that automatically checks if the operationResult is success or not.
If the operationResult is not success, it will execute the success handler, otherwise it will do nothing.

Parameters
successHandlerThe Handler, with the return value as a parameter, that will be executed in case of success.
Returns
The Action<perationResult<T>> Completion Handler
CompletionHandlerFactory.Success<int>( (myNumber) => { Console.WriteLine(myNumber.ToString()); });
static Action<OperationResult> VisionSDK.Afterward.IfSuccessIfFailure ( Action  successHandler,
Action< OperationResult >  failureHandler 
)
static

Create a completion handler with the format of : Action<OperationResult> that automatically checks if the operationResult is success or not.
If the operationResult is success, it will execute the success handler, otherwise it will execute the failure handler with OperationResult as the input.

Parameters
successHandlerThe Handler, with no parameter, that will be executed in case of success
failureHandlerThe Handler, with OperationResult as a parameter, that will be executed in case of failure
Returns
The Action<OperationResult> Completion Handler
CompletionHandlerFactory.SuccessFailure( () => { Console.WriteLine("Success"); }, (visionOperationResult) => { Console.WriteLine("Failure" + visionOperation); });
static Action<OperationResult<T> > VisionSDK.Afterward.IfSuccessIfFailure< T > ( Action< T >  successHandler,
Action< OperationResult< T >>  failureHandler 
)
static

Create a completion handler with the format of : Action<OperationResult<T>> that automatically checks if the operationResult is success or not.
If operationResult is success, it will execute the success handler, otherwise it will execute the failure handler with OperationResult as the input.

Parameters
successHandlerThe Handler, with the return value as a parameter, that will be executed in case of success
failureHandlerThe Handler, with OperationResult as a parameter, that will be executed in case of failure
Returns
The Action<OperationResult<T>> Completion Handler
CompletionHandlerFactory.SuccessFailure<int>( (myNumber) => { Console.WriteLine(myNumber.ToString()); }, (visionOperationResult) => { Console.WriteLine("Failure" + visionOperationResult.Message); });
HTML Footer Datalogic Automation, Inc.    ©2016 Datalogic Automation Inc. All Rights Reserved