Exemple #1
0
 /// <summary>
 /// Restarts MonoDevelop
 /// </summary>
 /// <returns> false if the user cancels exiting. </returns>
 /// <param name="reopenWorkspace"> true to reopen current workspace. </param>
 /// <remarks>
 /// Starts a new MonoDevelop instance in a new process and
 /// stops the current MonoDevelop instance.
 /// </remarks>
 public static async Task <bool> Restart(bool reopenWorkspace = false)
 {
     if (await Exit())
     {
         try {
             DesktopService.RestartIde(reopenWorkspace);
         } catch (Exception ex) {
             LoggingService.LogError("Restarting IDE failed", ex);
         }
         // return true here even if DesktopService.RestartIde has failed,
         // because the Ide has already been closed.
         return(true);
     }
     return(false);
 }
Exemple #2
0
        /// <summary>
        /// Restarts MonoDevelop
        /// </summary>
        /// <returns> false if the user cancels exiting. </returns>
        /// <param name="reopenWorkspace"> true to reopen current workspace. </param>
        /// <remarks>
        /// Starts a new MonoDevelop instance in a new process and
        /// stops the current MonoDevelop instance.
        /// </remarks>
        public static async Task <bool> Restart(bool reopenWorkspace = false)
        {
            if (await Exit())
            {
                // Log that we restarted ourselves
                PropertyService.Set("MonoDevelop.Core.RestartRequested", true);

                try {
                    DesktopService.RestartIde(reopenWorkspace);
                } catch (Exception ex) {
                    LoggingService.LogError("Restarting IDE failed", ex);
                }
                // return true here even if DesktopService.RestartIde has failed,
                // because the Ide has already been closed.
                return(true);
            }
            return(false);
        }