public static void SetReceivedFunction <T>() { if (ReceivedFunction == null || (ReceivedFunction != null && ReceivedFunction.GetType().Name != typeof(T).Name)) { ReceivedFunction = (ISerialPortDataReceived)Activator.CreateInstance <T>(); } OverTimeManager.Start(); }
private static void Host_PostStopIcCardEncrypt(object sender, Chromium.Remote.Event.CfrV8HandlerExecuteEventArgs e) { try { ISerialPortDataReceived dataReceived = ReceivedManager.ReceivedFunction; if (dataReceived is IcCardEncrypt) { ((IcCardEncrypt)dataReceived).StopEncrypt = true; } } catch (Exception ex) { Log4Helper.ErrorInfo(ex.Message, ex); ViewCallFunction.ViewAlert(ex.Message); } }