Skip to content

Fix analyzer warnings for CsWinRTAotWarningLevel 2 #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class BooleanNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class BooleanNode : ExpressionNode
public sealed partial class BooleanNode : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="BooleanNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class ColorNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class ColorNode : ExpressionNode
public sealed partial class ColorNode : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="ColorNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class Matrix3x2Node. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class Matrix3x2Node : ExpressionNode
public sealed partial class Matrix3x2Node : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="Matrix3x2Node"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class QuaternionNode. This class cannot be inherited.
/// </summary>
/// <seealso cref=CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class QuaternionNode : ExpressionNode
public sealed partial class QuaternionNode : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="QuaternionNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class ScalarNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class ScalarNode : ExpressionNode
public sealed partial class ScalarNode : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="ScalarNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class Vector2Node. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class Vector2Node : ExpressionNode
public sealed partial class Vector2Node : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="Vector2Node"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class Vector3Node. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class Vector3Node : ExpressionNode
public sealed partial class Vector3Node : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="Vector3Node"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class Vector4Node. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ExpressionNode" />
public sealed class Vector4Node : ExpressionNode
public sealed partial class Vector4Node : ExpressionNode
{
/// <summary>
/// Initializes a new instance of the <see cref="Vector4Node"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class AmbientLightReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="ReferenceNode" />
public sealed class AmbientLightReferenceNode : ReferenceNode
public sealed partial class AmbientLightReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="AmbientLightReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class ColorBrushReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class ColorBrushReferenceNode : ReferenceNode
public sealed partial class ColorBrushReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="ColorBrushReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class DistantLightReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class DistantLightReferenceNode : ReferenceNode
public sealed partial class DistantLightReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="DistantLightReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class DropShadowReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class DropShadowReferenceNode : ReferenceNode
public sealed partial class DropShadowReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="DropShadowReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class InsetClipReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class InsetClipReferenceNode : ReferenceNode
public sealed partial class InsetClipReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="InsetClipReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class InteractionTrackerReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class InteractionTrackerReferenceNode : ReferenceNode
public sealed partial class InteractionTrackerReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="InteractionTrackerReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class ManipulationPropertySetReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.PropertySetReferenceNode" />
public sealed class ManipulationPropertySetReferenceNode : PropertySetReferenceNode
public sealed partial class ManipulationPropertySetReferenceNode : PropertySetReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="ManipulationPropertySetReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class NineGridBrushReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class NineGridBrushReferenceNode : ReferenceNode
public sealed partial class NineGridBrushReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="NineGridBrushReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class PointLightReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class PointLightReferenceNode : ReferenceNode
public sealed partial class PointLightReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="PointLightReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class PointerPositionPropertySetReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.PropertySetReferenceNode" />
public sealed class PointerPositionPropertySetReferenceNode : PropertySetReferenceNode
public sealed partial class PointerPositionPropertySetReferenceNode : PropertySetReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="PointerPositionPropertySetReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class PropertySetReferenceNode.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public class PropertySetReferenceNode : ReferenceNode
public partial class PropertySetReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="PropertySetReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class SpotLightReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class SpotLightReferenceNode : ReferenceNode
public sealed partial class SpotLightReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="SpotLightReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class SurfaceBrushReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class SurfaceBrushReferenceNode : ReferenceNode
public sealed partial class SurfaceBrushReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="SurfaceBrushReferenceNode"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Animations.Expressions;
/// Class VisualReferenceNode. This class cannot be inherited.
/// </summary>
/// <seealso cref="CommunityToolkit.WinUI.Animations.Expressions.ReferenceNode" />
public sealed class VisualReferenceNode : ReferenceNode
public sealed partial class VisualReferenceNode : ReferenceNode
{
/// <summary>
/// Initializes a new instance of the <see cref="VisualReferenceNode" /> class.
Expand Down
2 changes: 1 addition & 1 deletion components/Behaviors/src/FocusTargetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ namespace CommunityToolkit.WinUI.Behaviors;
/// <summary>
/// A collection of <see cref="FocusTarget"/>.
/// </summary>
public sealed class FocusTargetList : List<FocusTarget>
public sealed partial class FocusTargetList : List<FocusTarget>
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public IDisposable DeferRefresh()
/// Notification deferrer helper class
/// </summary>
#pragma warning disable CA1063 // Implement IDisposable Correctly
public class NotificationDeferrer : IDisposable
public partial class NotificationDeferrer : IDisposable
#pragma warning restore CA1063 // Implement IDisposable Correctly
{
private readonly AdvancedCollectionView _acvs;
Expand Down
2 changes: 1 addition & 1 deletion components/Helpers/src/CameraHelper/CameraHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Helpers;
/// Make sure you have the capability webcam enabled for your app to access the device's camera.
/// </summary>
#pragma warning disable CA1063 // Implement IDisposable Correctly
public class CameraHelper : IDisposable
public partial class CameraHelper : IDisposable
{
private static IReadOnlyList<MediaFrameSourceGroup>? _frameSourceGroups;
#pragma warning disable CA2213 // Disposable fields should be disposed
Expand Down
2 changes: 1 addition & 1 deletion components/Helpers/src/ThemeListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace CommunityToolkit.WinUI.Helpers;
/// and Signals an Event when they occur.
/// </summary>
[AllowForWeb]
public sealed class ThemeListener : IDisposable
public sealed partial class ThemeListener : IDisposable
{
/// <summary>
/// Gets the Name of the Current Theme.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ namespace CommunityToolkit.WinUI.Media;
/// An <see langword="async"/> <see cref="AsyncMutex"/> implementation that can be easily used inside a <see langword="using"/> block
/// </summary>
#pragma warning disable CA1001 // Types that own disposable fields should be disposable
#pragma warning disable CsWinRT1028 // Partial not required for types never passed to native WinRT method.
internal sealed class AsyncMutex
#pragma warning restore CsWinRT1028
#pragma warning restore CA1001 // Types that own disposable fields should be disposable
{
/// <summary>
Expand All @@ -32,7 +34,9 @@ public async Task<IDisposable> LockAsync()
/// <summary>
/// Private class that implements the automatic release of the semaphore
/// </summary>
#pragma warning disable CsWinRT1028 // Partial not required for types never passed to native WinRT method.
private sealed class Lock : IDisposable
#pragma warning restore CsWinRT1028
{
/// <summary>
/// The <see cref="SemaphoreSlim"/> instance of the parent class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace CommunityToolkit.WinUI.Controls;

[DebuggerDisplay("Count = {Count}, Height = {Height}")]
internal class StaggeredColumnLayout : List<StaggeredItem>
internal partial class StaggeredColumnLayout : List<StaggeredItem>
{
public double Height { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion components/RichSuggestBox/src/RichSuggestToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace CommunityToolkit.WinUI.Controls;
/// <summary>
/// RichSuggestToken describes a suggestion token in the document.
/// </summary>
public class RichSuggestToken : INotifyPropertyChanged
public partial class RichSuggestToken : INotifyPropertyChanged
{
/// <inheritdoc/>
public event PropertyChangedEventHandler? PropertyChanged;
Expand Down
2 changes: 1 addition & 1 deletion components/SettingsControls/src/Helpers/StyleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI.Controls;
public static partial class StyleExtensions
{
// Used to distinct normal ResourceDictionary and the one we add.
private sealed class StyleExtensionResourceDictionary : ResourceDictionary
private sealed partial class StyleExtensionResourceDictionary : ResourceDictionary
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommunityToolkit.WinUI.Controls;
#pragma warning disable CS8622
#pragma warning disable CS8603
#pragma warning disable CS8714
internal class InterspersedObservableCollection : IList, IEnumerable<object>, INotifyCollectionChanged
internal partial class InterspersedObservableCollection : IList, IEnumerable<object>, INotifyCollectionChanged
{
public IList ItemsSource { get; private set; }

Expand Down
Loading