예제 #1
0
        private async void selectTargetFile(object sender, RoutedEventArgs e)
        {
            var picker = new Windows.Storage.Pickers.FileOpenPicker();

            picker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop;
            picker.FileTypeFilter.Add("*");
            Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();

            if (file != null)
            {
                // Removes the "New TF will open..." message
                this.textBlock4.Text = "";

                if (this.tf != null)
                {
                    tf.refreshLetters(); //Refreshes the Linked List counter in previous TargetFile
                }

                this.tf = new TargetFile(file, file.Path, tmpEntriesCount);

                textBlock3.Text = "Finding all characters in the target file, please wait...";
                disableAllControls();
                await Task.Run(() => findLet());

                enableAllControls();
                textBlock3.Text = "";

                targetFilePath    = file.Path;
                textBlock1.Text   = "Target file: " + targetFilePath;
                button3.IsEnabled = true;

                if (mf != null && PWS.Count > 0)
                {
                    button5.IsEnabled = true;
                }
                else
                {
                    button5.IsEnabled = false;
                }


                if (listBox.Items.Count > 0)
                {
                    button2.IsEnabled = true;
                }
                else
                {
                    button2.IsEnabled = false;
                }
            }
            else
            {
                // do nothing
            }
        }