예제 #1
0
 // Other/shared functions //
 public bool ConfirmClosure()
 {
     try
     {
         string thisPage = PageFunctions.ThisPageName();
         string question = "Are you sure you want to exit?";
         if (thisPage != Globals.TilesPageName && thisPage != "LoginPage")
         {
             question = question + " Any unsaved changes you have made would be lost.";
             return(MessageFunctions.WarningYesNo(question, "Close ProjectTile Application?"));
         }
         else
         {
             return(MessageFunctions.ConfirmOKCancel(question, "Close ProjectTile Application?"));
         }
     }
     catch
     {
         // Do nothing as it's not worth raising an error when the user wants to leave
         return(true);
     }
 }