Beispiel #1
0
        public static CoreResult[] Check(string image)
        {
            coreOptions.searchPath = new[] {
                new CorePathWithSubFolder(Paths.Sources, true),
                new CorePathWithSubFolder(image, false)
            };

            coreOptions.Set(core, options.onePath);
            core.Clear(CoreDll.FileType.Result);
            core.Clear(CoreDll.FileType.Temporary);
            core.Load(CoreDll.FileType.ImageDataBase, coreOptions.GetImageDataBasePath(), false);
            core.Search();
            core.ApplyToResult(CoreDll.GlobalActionType.SetGroup);
            core.ApplyToResult(CoreDll.GlobalActionType.SetHint);
            core.Save(CoreDll.FileType.ImageDataBase, coreOptions.GetImageDataBasePath());
            core.Clear(CoreDll.FileType.ImageDataBase);
            core.SortResult((CoreDll.SortType)options.resultsOptions.sortTypeDefault, options.resultsOptions.increasingDefault);

            var count = core.GetResultSize();

            if (count == 0)
            {
                return(new CoreResult[] { });
            }
            var images = core.GetResult(0, count);

            return(images.Where(match => Path.GetFullPath(match.first.path) == image || Path.GetFullPath(match.second.path) == image).ToArray());
        }
Beispiel #2
0
        /// <summary>
        /// Method for ThreadStart delegate
        /// </summary>
        public void RunProcess()
        {
            var progressDialogViewModel = _progressDialogViewModel;

            var watch = System.Diagnostics.Stopwatch.StartNew();

            progressDialogViewModel.State = "progressWindow_ComputeHashes2";

            _mainViewModel.Options.CopyToDll();
            _mainViewModel.LocationsModel.CopyToDll();

            var result = _core.Search();

            watch.Stop();
            var elapsedMs = watch.ElapsedMilliseconds;

            //MessageBox.Show(elapsedMs.ToString());


            DuplPairViewModel[] result2 = _core.GetResult();

            if (result2.Any())
            {
                _mainViewModel.SetResult(result2);
            }

            _state = StateEnum.Finish;
        }