From 19593825d5f4a472a8f726a9b17fb90542d3804a Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Sun, 12 May 2019 11:24:09 +0200 Subject: [PATCH] Fix comments --- src/Avalonia.Controls/Application.cs | 42 +++++++++++-------- src/Avalonia.Controls/ShutdownMode.cs | 8 ++-- src/Avalonia.Controls/StartupEventArgs.cs | 2 +- .../App.xaml.cs | 7 +++- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/Avalonia.Controls/Application.cs b/src/Avalonia.Controls/Application.cs index 62f49f0f88..bbea3693cc 100644 --- a/src/Avalonia.Controls/Application.cs +++ b/src/Avalonia.Controls/Application.cs @@ -208,10 +208,12 @@ namespace Avalonia /// /// Runs the application's main loop. - /// This will return when the condition is met - /// or was called. /// - /// The application's exit code that is passed on the operating system. + /// + /// This will return when the condition is met + /// or was called. + /// + /// The application's exit code that is returned to the operating system on termination. public int Run() { return Run(new CancellationTokenSource()); @@ -219,12 +221,14 @@ namespace Avalonia /// /// Runs the application's main loop. - /// This will return when the condition is met - /// or was called. - /// This also returns when is closed. /// + /// + /// This will return when the condition is met + /// or was called. + /// This also returns when is closed. + /// /// The closable to track. - /// The application's exit code that is passed on the operating system. + /// The application's exit code that is returned to the operating system on termination. public int Run(ICloseable closable) { closable.Closed += (s, e) => _mainLoopCancellationTokenSource?.Cancel(); @@ -234,12 +238,14 @@ namespace Avalonia /// /// Runs the application's main loop. - /// This will return when the condition is met - /// or was called. /// + /// + /// This will return when the condition is met + /// or was called. + /// /// The window that is used as /// when the isn't already set. - /// The application's exit code that is passed on the operating system. + /// The application's exit code that is returned to the operating system on termination. public int Run(Window mainWindow) { if (mainWindow == null) @@ -264,11 +270,13 @@ namespace Avalonia } /// /// Runs the application's main loop. - /// This will return when the condition is met - /// or was called. - /// This also returns when the is canceled. /// - /// The application's exit code that is passed on the operating system. + /// + /// This will return when the condition is met + /// or was called. + /// This also returns when the is canceled. + /// + /// The application's exit code that is returned to the operating system on termination. /// The token to track. public int Run(CancellationToken token) { @@ -339,9 +347,7 @@ namespace Avalonia OnExit(e); - _exitCode = e.ApplicationExitCode; - - Environment.ExitCode = _exitCode; + _exitCode = e.ApplicationExitCode; } finally { @@ -350,6 +356,8 @@ namespace Avalonia _mainLoopCancellationTokenSource = null; IsShuttingDown = false; + + Environment.ExitCode = _exitCode; } } diff --git a/src/Avalonia.Controls/ShutdownMode.cs b/src/Avalonia.Controls/ShutdownMode.cs index 8c52d4b70e..46e27ff4e1 100644 --- a/src/Avalonia.Controls/ShutdownMode.cs +++ b/src/Avalonia.Controls/ShutdownMode.cs @@ -1,20 +1,20 @@ // Copyright (c) The Avalonia Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. -namespace Avalonia +namespace Avalonia.Controls { /// - /// Enum for ExitMode + /// Describes the possible values for . /// public enum ShutdownMode { /// - /// Indicates an implicit call to Application.Exit when the last window closes. + /// Indicates an implicit call to Application.Shutdown when the last window closes. /// OnLastWindowClose, /// - /// Indicates an implicit call to Application.Exit when the main window closes. + /// Indicates an implicit call to Application.Shutdown when the main window closes. /// OnMainWindowClose, diff --git a/src/Avalonia.Controls/StartupEventArgs.cs b/src/Avalonia.Controls/StartupEventArgs.cs index 17dcbb2aa9..0e12f5c01a 100644 --- a/src/Avalonia.Controls/StartupEventArgs.cs +++ b/src/Avalonia.Controls/StartupEventArgs.cs @@ -15,7 +15,7 @@ namespace Avalonia.Controls private string[] _args; /// - /// Gets command line arguments that were passed to the application. + /// Gets the command line arguments that were passed to the application. /// public IReadOnlyList Args => _args ?? (_args = GetArgs()); diff --git a/tests/Avalonia.DesignerSupport.TestApp/App.xaml.cs b/tests/Avalonia.DesignerSupport.TestApp/App.xaml.cs index 5ee3487b6b..653a51232b 100644 --- a/tests/Avalonia.DesignerSupport.TestApp/App.xaml.cs +++ b/tests/Avalonia.DesignerSupport.TestApp/App.xaml.cs @@ -1,4 +1,9 @@ -using Avalonia.Markup.Xaml; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Avalonia.Markup.Xaml; namespace Avalonia.DesignerSupport.TestApp {