Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit f719b07

Browse files
committed
IShutdownService.PreventShutdown(): display the message as-is (don't pass it through StringParser)
1 parent 143332d commit f719b07

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/Main/Base/Project/Parser/ProjectContentContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static void SaveToCache(string cacheFileName, IProjectContent pc)
205205
} catch (IOException ex) {
206206
LoggingService.Warn(ex);
207207
// Can happen if two SD instances are trying to access the file at the same time.
208-
// We'll just let one of them win, and instance that got the exception won't write to the cache at all.
208+
// We'll just let one of them win, and the instance that got the exception won't write to the cache at all.
209209
// Similarly, we also ignore the other kinds of IO exceptions.
210210
} catch (UnauthorizedAccessException ex) {
211211
LoggingService.Warn(ex);

src/Main/Base/Project/Workbench/IShutdownService.cs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,46 @@ public interface IShutdownService
1616
/// Attemps to close the IDE.
1717
/// </summary>
1818
/// <remarks>
19-
/// This method will:
20-
/// - Check if <see cref="PreventShutdown"/> was called and abort the shutdown if it was.
21-
/// - Prompt the user to save the open files. The user has the option to cancel the shutdown at that point.
22-
/// - Closes the solution.
23-
/// - Signals the <see cref="ShutdownToken"/>.
24-
/// - Disposes pads
25-
/// - Wait for background tasks (<see cref="AddBackgroundTask"/>) to finish.
26-
/// - Disposes services
27-
/// - Saves the PropertyService
28-
///
19+
/// <para>This method:</para>
20+
/// <list type="items">
21+
/// <item>Checks if <see cref="PreventShutdown"/> was called and abort the shutdown if it was.</item>
22+
/// <item>Prompts the user to save the open files. The user has the option to cancel the shutdown at that point.</item>
23+
/// <item>Closes the solution.</item>
24+
/// <item>Signals the <see cref="ShutdownToken"/>.</item>
25+
/// <item>Disposes pads</item>
26+
/// <item>Waits for background tasks (<see cref="AddBackgroundTask"/>) to finish.</item>
27+
/// <item>Disposes services</item>
28+
/// <item>Saves the PropertyService</item>
29+
/// </list>
30+
/// <para>
2931
/// This method must be called on the main thread.
32+
/// </para>
3033
/// </remarks>
3134
bool Shutdown();
3235

3336
/// <summary>
3437
/// Prevents shutdown with the following reason.
3538
/// Dispose the returned value to allow shutdown again.
3639
/// </summary>
37-
/// <param name="reason">The reason. This parameter will be passed through the StringParser when the reason is displayed to the user.</param>
40+
/// <param name="reason">The reason, will be displayed to the user.</param>
3841
/// <exception cref="InvalidOperationException">Shutdown is already in progress</exception>
3942
/// <remarks>This method is thread-safe.</remarks>
4043
IDisposable PreventShutdown(string reason);
4144

4245
/// <summary>
4346
/// Gets the current reason that prevents shutdown.
4447
/// If there isn't any reason, returns null.
45-
/// If there are multiple reasons, this returns one of them.
48+
/// If there are multiple reasons, only one of them is returned.
4649
/// </summary>
47-
/// <remarks>This method is thread-safe.</remarks>
50+
/// <remarks>This property is thread-safe.</remarks>
4851
string CurrentReasonPreventingShutdown { get; }
4952

5053
/// <summary>
5154
/// Gets a cancellation token that gets signalled when SharpDevelop is shutting down.
5255
///
5356
/// This cancellation token may be used to stop background calculations.
5457
/// </summary>
58+
/// <remarks>This property is thread-safe.</remarks>
5559
CancellationToken ShutdownToken { get; }
5660

5761
/// <summary>
@@ -61,6 +65,7 @@ public interface IShutdownService
6165
/// for a limited time after SharpDevelop is closed (e.g. saving state in caches
6266
/// - work that should better run even though we're shutting down, but shouldn't take too long either)
6367
/// </summary>
68+
/// <remarks>This property is thread-safe.</remarks>
6469
CancellationToken DelayedShutdownToken { get; }
6570

6671
/// <summary>
@@ -69,6 +74,7 @@ public interface IShutdownService
6974
/// Use this method for tasks that asynchronously write state to disk and should not be
7075
/// interrupted by SharpDevelop closing down.
7176
/// </summary>
77+
/// <remarks>This method is thread-safe.</remarks>
7278
void AddBackgroundTask(Task task);
7379
}
7480
}

src/Main/SharpDevelop/Workbench/WpfWorkbench.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ protected override void OnClosing(CancelEventArgs e)
579579

580580
var shutdownService = (ShutdownService)SD.ShutdownService;
581581
if (shutdownService.CurrentReasonPreventingShutdown != null) {
582-
MessageService.ShowMessage(StringParser.Parse(shutdownService.CurrentReasonPreventingShutdown));
582+
MessageService.ShowMessage(shutdownService.CurrentReasonPreventingShutdown);
583583
e.Cancel = true;
584584
return;
585585
}

0 commit comments

Comments
 (0)