Beispiel #1
0
        private async Task InitMac()
        {
            var config = _fileConfiguration.GetConfig <Configs>();

            if (!string.IsNullOrEmpty(config.DeviceMac))
            {
                return;
            }
            config.DeviceMac = GetMac();
            await _fileConfiguration.SetConfigurationInFileAsync(config);
        }
Beispiel #2
0
        private static void RegisterDevice(IUnityContainer container, IFileConfiguration fileConfiguration)
        {
            var deviceType = fileConfiguration.GetConfig <Configs>().DeviceType;

            if (deviceType == DeviceType.Dk)
            {
                container.RegisterType <ICardReader, DkCardReader>();
                return;
            }
            if (deviceType == DeviceType.Ts)
            {
                container.RegisterType <ICardReader, TsCardReader>();
                return;
            }
            if (deviceType == DeviceType.Hs)
            {
                container.RegisterType <ICardReader, HsCardReader>();
                return;
            }
            if (deviceType == DeviceType.Hx)
            {
                container.RegisterType <ICardReader, HxCardReader>();
            }
        }