示例#1
0
        internal void AddRipGrepOutput(string output)
        {
            var file = output.Split(":".ToCharArray(), 2);

            if (file.Length != 1 && file.Length != 2)
            {
                return;
            }

            file[0] = System.IO.Path.Combine(BasePath, file[0]);

            ResultFileModel resultFile = null;

            if (!Files.TryGetValue(file[0], out resultFile))
            {
                resultFile = new ResultFileModel(this, file[0]);
                Files.Add(file[0], resultFile);
                ResultFiles.Add(resultFile);
            }

            if (file.Length == 2)
            {
                resultFile.AddRipGrepOutput(file[1]);
            }
        }
示例#2
0
        protected async override void OnActivate()
        {
            IsBusy = true;
            ResultFiles.Clear();
            var files = await storageFolder.GetFilesAsync();

            var resultFiles = files.Where(x => x.Name.EndsWith(".result", StringComparison.OrdinalIgnoreCase)).ToList();

            foreach (var storageFile in resultFiles)
            {
                var modificationDate = (await storageFile.GetBasicPropertiesAsync()).DateModified;
                fileManager.FileName = storageFile.Name;
                var testResult = await fileManager.Get <HearingTestResult>();

                ResultFiles.Add(new ResultFileViewModel
                {
                    CreationDate    = storageFile.DateCreated.DateTime,
                    LastChangedDate = modificationDate.DateTime,
                    FileName        = storageFile.Name,
                    Description     = testResult.Description
                });
            }
            IsBusy = false;
        }