public SendPinService()
 {
     PinServiceHandleSwitch
     .CaseWhen(Code.Authenticate, Authenticate)
     .CaseWhen(Code.Connect, Connect)
     .CaseWhen(Code.Disconnect, Disconnect);
 }
 public RecievePinService()
 {
     PinServiceHandleSwitch
     .CaseWhen(Code.BeginTransmit, BeginTransmit)
     .CaseWhen(Code.DataTransmit, DataTransmit)
     .CaseWhen(Code.BinaryTransmit, BinaryTransmit)
     .CaseWhen(Code.EndTransmit, EndTransmit);
 }
        public virtual IResult Handle(Code code, ISmartCardState smartCardState, ISmartCardData cardData)
        {
            var action = PinServiceHandleSwitch.Case(code);

            if (action == null)
            {
                return(SmartCardResult
                       .CreateError(Result.UndeterminedResult, Code.Error));
            }

            return(action.Invoke(smartCardState, cardData));
        }
 public ResetPinService()
 {
     PinServiceHandleSwitch.CaseWhen(Code.Request, RequestReset);
 }