Example #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        public App()
        {
            // 初始化
            rfidSystem = new RfidSystem(EPortType.PORT_TYPE_UART, EReaderType.READER_TYPE_R2000, 4);

            Preferences.Set("App", "init");

            // 没有初始化
            if (!rfidSystem.IsInit())
            {
                Debug.Print("-->未初始化!");
                // 清除
                Preferences.Clean();
                // 保存
                rfidSystem.SetupUpdate(true);
                // 立即初始化
                rfidSystem.SetInit(true);
                // 记忆
                Preferences.Flush();
            }
            else
            {
                Debug.Print("-->已经初始化!");
                // 读取
                rfidSystem.SetupUpdate(false);
            }

            if (DEBUG)
            {
                Debug.Print(Preferences.GetInstance().ToString());
            }
        }
 protected override IDatabasePreferences Clean(IPreferences entity) => Preferences.Clean(entity);
Example #3
0
            protected override IDatabasePreferences CreateCleanWithPositiveIdFrom(IDatabasePreferences entity)
            {
                var preferences = new Ultrawave.Models.Preferences(entity);

                return(Preferences.Clean(preferences));
            }
Example #4
0
 protected override IDatabasePreferences CreateCleanEntityFrom(IDatabasePreferences entity)
 => Preferences.Clean(entity);
 protected override IDatabasePreferences ConvertToDatabaseEntity(IPreferences entity)
 => Preferences.Clean(entity);