Example #1
0
        /// <summary>
        /// Open the OpenLoadfileDialog to browse the filesystem for a loadfile
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOpen_Click(object sender, RoutedEventArgs e)
        {
            OpenLoadfileDialog Olfd = new OpenLoadfileDialog();

            if (Olfd.ShowDialog() == true)
            {
                BuildNewLoadfileView(Olfd.SelectedLoadfile);
            }
        }
Example #2
0
        private void File_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                // Note that you can have more than one file.
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                if (File.Exists(files[0]))
                {
                    OpenLoadfileDialog Olfd = new OpenLoadfileDialog(files[0]);

                    if (Olfd.ShowDialog() == true)
                    {
                        BuildNewLoadfileView(Olfd.SelectedLoadfile);
                    }
                }
                else
                {
                    this.tblStatus.Text = "File does not exist: \"" + files[0] + "\"";
                }
            }
        }