Example #1
0
        private void SelectFolder(object sender, RoutedEventArgs e)
        {
            if (!IsRunning)
            {
                using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
                {
                    if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        try
                        {
                            Folders   = 0;
                            HashCount = 0;
                            Refresh();
                            Collision = false;

                            WebB.InvokeScript("AddInfo", new object[] { "Select for start to test" });
                            var t = new Thread(StartSearch);
                            t.Start(dialog.SelectedPath);
                        }
                        catch (Exception)
                        {
                            // Console.WriteLine("The process failed: {0}", ex.ToString());
                        }
                    }
                }
            }
            else
            {
                MessageBoxResult result = MessageBox.Show("Do you want to stop current processing?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    IsClosing = true;
                }
            }
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            IsClosing = false;
            IsRunning = false;

            VisualMd vm = new VisualMd
            {
                Ls32 = this.Ls32,
                Ls64 = this.Ls64
            };

            DataContext = vm;
            Stream source = (Stream)Assembly.GetExecutingAssembly().GetManifestResourceStream("WpfHashDemo.Content.Main.html");

            WebB.NavigateToStream(source);
            Clear();
        }