From 3deddbe3050f67d2819d1710b2f1062b7b15868e Mon Sep 17 00:00:00 2001 From: shangchenglumetro Date: Wed, 31 Jul 2024 14:39:46 +0900 Subject: [PATCH] chore: fix some comments (#16461) --- src/Avalonia.Base/Data/BindingChainException.cs | 6 +++--- src/Avalonia.FreeDesktop/DBusXml/com.canonical.dbusmenu.xml | 4 ++-- src/Windows/Avalonia.Direct2D1/Media/GeometryImpl.cs | 4 ++-- src/Windows/Avalonia.Win32/Interop/Win32Icon.cs | 2 +- src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs | 2 +- src/tools/Avalonia.Generators/GeneratorContextExtensions.cs | 2 +- tests/Avalonia.Base.UnitTests/Layout/LayoutManagerTests.cs | 2 +- tests/Avalonia.Controls.UnitTests/ListBoxTests_Single.cs | 4 ++-- .../Primitives/SelectingItemsControlTests.cs | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Avalonia.Base/Data/BindingChainException.cs b/src/Avalonia.Base/Data/BindingChainException.cs index 517440eb9b..37f9cecc8d 100644 --- a/src/Avalonia.Base/Data/BindingChainException.cs +++ b/src/Avalonia.Base/Data/BindingChainException.cs @@ -60,15 +60,15 @@ namespace Avalonia.Data { if (Expression != null && ExpressionErrorPoint != null) { - return $"An error occured binding to '{Expression}' at '{ExpressionErrorPoint}': '{_message}'"; + return $"An error occurred binding to '{Expression}' at '{ExpressionErrorPoint}': '{_message}'"; } else if (Expression != null) { - return $"An error occured binding to '{Expression}': '{_message}'"; + return $"An error occurred binding to '{Expression}': '{_message}'"; } else { - return $"An error occured in a binding: '{_message}'"; + return $"An error occurred in a binding: '{_message}'"; } } } diff --git a/src/Avalonia.FreeDesktop/DBusXml/com.canonical.dbusmenu.xml b/src/Avalonia.FreeDesktop/DBusXml/com.canonical.dbusmenu.xml index de6868cb3e..d5622020c9 100644 --- a/src/Avalonia.FreeDesktop/DBusXml/com.canonical.dbusmenu.xml +++ b/src/Avalonia.FreeDesktop/DBusXml/com.canonical.dbusmenu.xml @@ -322,7 +322,7 @@ License version 3 and version 2.1 along with this program. If not, see event-specific data - The time that the event occured if available or the time the message was sent if not + The time that the event occurred if available or the time the message was sent if not @@ -427,7 +427,7 @@ License version 3 and version 2.1 along with this program. If not, see ID of the menu that should be activated - The time that the event occured + The time that the event occurred diff --git a/src/Windows/Avalonia.Direct2D1/Media/GeometryImpl.cs b/src/Windows/Avalonia.Direct2D1/Media/GeometryImpl.cs index fec9b37aac..2399dd69eb 100644 --- a/src/Windows/Avalonia.Direct2D1/Media/GeometryImpl.cs +++ b/src/Windows/Avalonia.Direct2D1/Media/GeometryImpl.cs @@ -109,7 +109,7 @@ namespace Avalonia.Direct2D1.Media /// public bool TryGetPointAndTangentAtDistance(double distance, out Point point, out Point tangent) { - // Direct2D doesnt have this sadly. + // Direct2D doesn't have this sadly. Logger.TryGet(LogEventLevel.Warning, LogArea.Visual)?.Log(this, "TryGetPointAndTangentAtDistance is not available in Direct2D."); point = new Point(); tangent = new Point(); @@ -118,7 +118,7 @@ namespace Avalonia.Direct2D1.Media public bool TryGetSegment(double startDistance, double stopDistance, bool startOnBeginFigure, out IGeometryImpl segmentGeometry) { - // Direct2D doesnt have this too sadly. + // Direct2D doesn't have this too sadly. Logger.TryGet(LogEventLevel.Warning, LogArea.Visual)?.Log(this, "TryGetSegment is not available in Direct2D."); segmentGeometry = null; diff --git a/src/Windows/Avalonia.Win32/Interop/Win32Icon.cs b/src/Windows/Avalonia.Win32/Interop/Win32Icon.cs index d0da2226cd..0a23ffde4d 100644 --- a/src/Windows/Avalonia.Win32/Interop/Win32Icon.cs +++ b/src/Windows/Avalonia.Win32/Interop/Win32Icon.cs @@ -245,7 +245,7 @@ internal class Win32Icon : IDisposable iconBitDepth = 8; } - // Windows rules for specifing an icon: + // Windows rules for specifying an icon: // // 1. The icon with the closest size match. // 2. For matching sizes, the image with the closest bit depth. diff --git a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs index 6cd1c52354..648f01c8c6 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs @@ -946,7 +946,7 @@ namespace Avalonia.Win32 { continue; } - // Skip poins older from previous WM_MOUSEMOVE point. + // Skip points older from previous WM_MOUSEMOVE point. if (historyInfo.time < prevMovePoint.time || (historyInfo.time == prevMovePoint.time && historyInfo.x == prevMovePoint.x && diff --git a/src/tools/Avalonia.Generators/GeneratorContextExtensions.cs b/src/tools/Avalonia.Generators/GeneratorContextExtensions.cs index a388e74d27..b1f7738a8a 100644 --- a/src/tools/Avalonia.Generators/GeneratorContextExtensions.cs +++ b/src/tools/Avalonia.Generators/GeneratorContextExtensions.cs @@ -19,7 +19,7 @@ internal static class GeneratorContextExtensions public static void ReportNameGeneratorUnhandledError(this GeneratorExecutionContext context, Exception error) => context.Report(UnhandledErrorDescriptorId, - "Unhandled exception occured while generating typed Name references. " + + "Unhandled exception occurred while generating typed Name references. " + "Please file an issue: https://github.com/avaloniaui/Avalonia", error.Message, error.ToString()); diff --git a/tests/Avalonia.Base.UnitTests/Layout/LayoutManagerTests.cs b/tests/Avalonia.Base.UnitTests/Layout/LayoutManagerTests.cs index 0a5f690383..0cdf177501 100644 --- a/tests/Avalonia.Base.UnitTests/Layout/LayoutManagerTests.cs +++ b/tests/Avalonia.Base.UnitTests/Layout/LayoutManagerTests.cs @@ -391,7 +391,7 @@ namespace Avalonia.Base.UnitTests.Layout root.LayoutManager.ExecuteLayoutPass(); - //altough nonArrageableTargets has rubbish logic and can't be measured/arranged properly + //although nonArrageableTargets has rubbish logic and can't be measured/arranged properly //layoutmanager should process properly other visuals Assert.All(targets, c => Assert.True(c.Arranged)); } diff --git a/tests/Avalonia.Controls.UnitTests/ListBoxTests_Single.cs b/tests/Avalonia.Controls.UnitTests/ListBoxTests_Single.cs index f442202e26..e7acceb2c4 100644 --- a/tests/Avalonia.Controls.UnitTests/ListBoxTests_Single.cs +++ b/tests/Avalonia.Controls.UnitTests/ListBoxTests_Single.cs @@ -228,7 +228,7 @@ namespace Avalonia.Controls.UnitTests Assert.Equal(0, viewModel.SetterInvokedCount); - // In Issue #855, a Stackoverflow occured here. + // In Issue #855, a Stackoverflow occurred here. target.SelectedItem = viewModel.Items[2]; Assert.Equal(viewModel.Items[1], target.SelectedItem); @@ -307,7 +307,7 @@ namespace Avalonia.Controls.UnitTests // Then make the ScrollViewer create its child. scrollViewer.Presenter.UpdateChild(); - // Now the ItemsPresenter should be reigstered, so apply its template. + // Now the ItemsPresenter should be registered, so apply its template. target.Presenter.ApplyTemplate(); } } diff --git a/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs b/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs index 1e4711cb0f..5c1ece224a 100644 --- a/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs +++ b/tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs @@ -2376,7 +2376,7 @@ namespace Avalonia.Controls.UnitTests.Primitives target.SelectedValueBinding = new Binding(nameof(ItemModel.Id)); break; default: - throw new InvalidOperationException($"Unkown field {field}"); + throw new InvalidOperationException($"Unknown field {field}"); } }