/// <summary>
        /// Метод генерации записей в отдельном потоке
        /// </summary>
        public void StartGeneration()
        {
            if (generationProcess)
            {
                generationProcess = false;
            }
            else
            {
                buttonText        = "Остановить";
                status            = "Идет генерация записей";
                generationProcess = true;

                if (RecordList != null)
                {
                    RecordList.Clear();
                }

                cg.DoGenerationAsync(recordsCount);

                RecordList = cg.localRecordList;

                generationProcess = false;
                status            = "Ожидание начала работы";
                buttonText        = "Генерировать";
                count             = "Всего: " + RecordList.Count;
                GC.Collect();
            }
        }
示例#2
0
        //读出备份数据,同时将备份数据写入本地文件
        public async Task ReadBackupAsync(SaveType st)
        {
            IsProgressRingVisible = true;
            SettingResult         = "开始恢复...";
            string strRecover = await FileManager.RecoverAsync(st);

            if (strRecover.StartsWith("-"))
            {
                SettingResult         = strRecover.Substring(1);
                IsProgressRingVisible = false;
                return;
            }
            await FileManager.BackupAsync(strRecover, SaveType.LocalState);

            switch (strRecover.Substring(0, 3))
            {
            case "02|":
                RightPwdMd5 = strRecover.Substring(3, 32);
                break;

            default:
                RightPwdMd5 = strRecover.Substring(0, 32);
                break;
            }
            SettingResult = "恢复成功!";
            IsCheck       = false;
            RecordList.Clear();
            UserInputPwd          = "";
            IsLstMainSelected     = true;
            IsProgressRingVisible = false;
        }
示例#3
0
        private void AddRecord()
        {
            Record record = new Record()
            {
                RecordTime = DateTime.Now.ToShortTimeString(),
                RecordText = OcrResult
            };

            RecordList.Add(record);
            List <Record> reclist = new List <Record>();

            foreach (var item in RecordList)
            {
                reclist.Add(item);
            }
            reclist.Reverse();
            RecordList.Clear();
            foreach (var item in reclist)
            {
                RecordList.Add(item);
            }
        }