Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Updater : Form {
- public Updater() {
- InitializeComponent();
- automaticUpdater1.wyUpdateLocation = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, automaticUpdater1.wyUpdateLocation);
- }
- private void button1_Click(object sender, EventArgs e) {
- /*
- * Due to the way the forms are set up between the Project application and the VSTO application, I need to
- * wrap the file exit functionality in my own save prompt. When one calls FileExit with no parameters it attempts to prompt the user to save.
- * However, the form isn't accessible since this is a .ShowDialog window. Switching to .Show introduced other
- * problems (would manually have to switch windows to get to the save dialog). Therefore, wrapping the exit
- * code and manually handling the save dialog is how we have to go about closing the app.
- */
- var dr = MessageBox.Show("Save?", "Save?", MessageBoxButtons.YesNoCancel);
- if (DialogResult.Yes == dr) {
- Controller.App.FileExit(Microsoft.Office.Interop.MSProject.PjSaveType.pjSave);
- } else if (DialogResult.No == dr) {
- Controller.App.FileExit(Microsoft.Office.Interop.MSProject.PjSaveType.pjDoNotSave);
- } else {
- //Cancel save/close
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment