示例#1
0
        private void open_Click(object sender, RoutedEventArgs e)
        {
            AllowDrop = false;
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                DirectoryInfo directory = new DirectoryInfo(dialog.SelectedPath);
                if (directory.Exists &&
                    directory.GetFiles().Any(x => x.Extension == ".dll" || x.Extension == ".exe"))
                {
                    SpecWindow = new SpecificationWindow();
                    SpecWindow.ShowDialog();

                    if (SpecWindow.OKClicked)
                    {
                        while (SpecWindow.OKClicked && !BuildAndDisplay(directory))
                        {
                            SpecWindow = new SpecificationWindow();
                            SpecWindow.ShowDialog();
                        }
                    }
                }
                else
                {
                    System.Windows.MessageBox.Show("Invalid Directory");
                }
            }
            AllowDrop = true;
        }
示例#2
0
        private void MainWindow_Drop(object sender, System.Windows.DragEventArgs e)
        {
            Topmost = true;
            string path = ((string[])e.Data.GetData(System.Windows.DataFormats.FileDrop))[0];

            Topmost = false;

            if (Directory.Exists(path))
            {
                AllowDrop  = false;
                SpecWindow = new SpecificationWindow();
                SpecWindow.ShowDialog();

                if (SpecWindow.OKClicked)
                {
                    while (SpecWindow.OKClicked && !BuildAndDisplay(new DirectoryInfo(path)))
                    {
                        SpecWindow = new SpecificationWindow();
                        SpecWindow.ShowDialog();
                    }
                }
            }
            else
            {
                System.Windows.MessageBox.Show("Invalid Directory");
            }

            AllowDrop = true;
        }