Example #1
0
        public void ShowManagementDialog()
        {
            var vm = new HashSetManagementDialogViewModel();

            vm.Initialize();
            var dialog = new HashSetManagementDialog {
                DataContext = vm
            };

            if (ShellService.Current.Shell is Window shell && shell.IsLoaded)
            {
                dialog.ShowInTaskbar = false;
                dialog.Owner         = shell;
            }

            dialog.ShowDialog();
            dialog.DataContext = null;

#if DEBUG
            Contracts.App.ThreadInvoker.BackInvoke(() => {
                System.Threading.Thread.Sleep(1000);
                for (int i = 0; i < 2; i++)
                {
                    System.GC.Collect();
                    System.GC.WaitForPendingFinalizers();
                }
            });
#endif
        }
        public void Initialize()
        {
            TestCommon.InitializeTest();
            HashSetManagementService.Initialize();
            HashSetManagementService.Current.ClearHashSets();

            var hashSet = HashSetFactory.CreateNew(
                "E:\\anli\\lucene",
                Guid.NewGuid().ToString("P"),
                GenericServiceStaticInstances <IHasher> .Currents.First(
                    p => p.GUID == SingularityForensic.Hash.Constants.HashTypeGUID_MD5
                    )
                );

            hashSet.Name = testHashSetName;
            HashSetManagementService.AddHashSet(hashSet);


            _vm = new HashSetManagementDialogViewModel();
            _vm.Initialize();
        }