private void b_View_Click(object sender, RoutedEventArgs e)
 {
     // Show the dialog. Note that AddFileDialog should modify the file if necessary.
     AddFileDialog window = new AddFileDialog(File);
     if (window.ShowDialog() == true)
     {
         // If something changed, update the parent menu
         ParentProjectMenu.RefreshFilesOnUI();
     }
 }
Exemplo n.º 2
0
        private void b_AddFile_Click(object sender, RoutedEventArgs e)
        {
            AddFileDialog window = new AddFileDialog();
            if (window.ShowDialog() == true)
            {
                // Create the file
                ProjectFile newFile;
                string filename = window.IsFile ? window.Filename : window.Url;
                if (window.OpenWithDefaultProgram)
                {
                    newFile = new ProjectFile(window.FileTitle, filename, window.IsFile, CurrentProject);
                }
                else
                {
                    newFile = new ProjectFile(window.FileTitle, filename, window.IsFile, window.ProgramToOpen, CurrentProject);
                }

                // Add the file
                AddFileToProject(newFile);
                RefreshFilesOnUI();
            }
        }