Skip to content
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
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dotnet_diagnostic.IL2050.severity = none
# Code analyzers
dotnet_diagnostic.CA1307.severity = error
dotnet_diagnostic.CA1309.severity = error
dotnet_diagnostic.CA1815.severity = error

# Modifier preferences
dotnet_style_require_accessibility_modifiers = never:suggestion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ protected override void Init()
}

[Preserve(AllMembers = true)]
#pragma warning disable CA1815 // Override equals and operator equals on value types
public struct Issue8958Model
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public string Title { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ Button MenuButton(TestPoint test)
}

[Preserve(AllMembers = true)]
#pragma warning disable CA1815 // Override equals and operator equals on value types
public struct TestPoint
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public TestPoint(int i) : this()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public enum ActivationFlags : long
DisableSetStatusBarColor = 1 << 0,
}

#pragma warning disable CA1815 // Override equals and operator equals on value types
public struct ActivationOptions
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public ActivationOptions(Bundle bundle)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Compatibility/Core/src/Android/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
namespace Microsoft.Maui.Controls.Compatibility
{
[Obsolete]
#pragma warning disable CA1815 // Override equals and operator equals on value types
public struct InitializationOptions
{
public struct EffectScope
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public string Name;
public ExportEffectAttribute[] Effects;
Expand Down
2 changes: 2 additions & 0 deletions src/Compatibility/Core/src/Tizen/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public enum PlatformType
}

[Obsolete]
#pragma warning disable CA1815 // Override equals and operator equals on value types
public class InitializationOptions
{
public CoreApplication Context { get; set; }
Expand All @@ -47,6 +48,7 @@ public class InitializationOptions
public DisplayResolutionUnit DisplayResolutionUnit { get; set; }

public struct EffectScope
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public string Name;
public ExportEffectAttribute[] Effects;
Expand Down
2 changes: 2 additions & 0 deletions src/Compatibility/Core/src/Windows/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
namespace Microsoft.Maui.Controls.Compatibility
{
[Obsolete]
#pragma warning disable CA1815 // Override equals and operator equals on value types
public struct InitializationOptions
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public InitializationOptions(UI.Xaml.LaunchActivatedEventArgs args)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Compatibility/Core/src/iOS/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
namespace Microsoft.Maui.Controls.Compatibility
{
[Obsolete]
#pragma warning disable CA1815 // Override equals and operator equals on value types
public struct InitializationOptions
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public InitializationFlags Flags;
}
Expand Down
12 changes: 11 additions & 1 deletion src/Controls/src/Core/LayoutOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.Maui.Controls
{
/// <include file="../../docs/Microsoft.Maui.Controls/LayoutOptions.xml" path="Type[@FullName='Microsoft.Maui.Controls.LayoutOptions']/Docs/*" />
[System.ComponentModel.TypeConverter(typeof(LayoutOptionsConverter))]
public struct LayoutOptions
public struct LayoutOptions : IEquatable<LayoutOptions>
{
int _flags;

Expand Down Expand Up @@ -73,5 +73,15 @@ internal Primitives.LayoutAlignment ToCore()

return Primitives.LayoutAlignment.Start;
}

public bool Equals(LayoutOptions other) => _flags == other._flags;

public override bool Equals(object obj) => obj is LayoutOptions other && Equals(other);

public override int GetHashCode() => _flags.GetHashCode();

public static bool operator ==(LayoutOptions left, LayoutOptions right) => left.Equals(right);

public static bool operator !=(LayoutOptions left, LayoutOptions right) => !(left == right);
}
}
2 changes: 2 additions & 0 deletions src/Controls/src/Core/Profiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ namespace Microsoft.Maui.Controls.Internals
{
/// <include file="../../docs/Microsoft.Maui.Controls.Internals/Profile.xml" path="Type[@FullName='Microsoft.Maui.Controls.Internals.Profile']/Docs/*" />
[EditorBrowsable(EditorBrowsableState.Never)]
#pragma warning disable CA1815 // Override equals and operator equals on value types
public struct Profile : IDisposable
{
const int Capacity = 1000;

[DebuggerDisplay("{Name,nq} {Id} {Ticks}")]
public struct Datum
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
public string Name;
public string Id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,29 @@
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Android.Content.Context! context, Microsoft.Maui.IPropertyMapper! mapper) -> void
Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Android.Content.Context! context, Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper! commandMapper) -> void
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
Microsoft.Maui.Controls.Region.Equals(Microsoft.Maui.Controls.Region other) -> bool
Microsoft.Maui.Controls.Shapes.Matrix.Equals(Microsoft.Maui.Controls.Shapes.Matrix other) -> bool
override Microsoft.Maui.Controls.LayoutOptions.GetHashCode() -> int
override Microsoft.Maui.Controls.Region.GetHashCode() -> int
override Microsoft.Maui.Controls.Shapes.Matrix.GetHashCode() -> int
override Microsoft.Maui.Controls.View.ChangeVisualState() -> void
static Microsoft.Maui.Controls.LayoutOptions.operator !=(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.LayoutOptions.operator ==(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.Region.operator !=(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Region.operator ==(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator !=(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator ==(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
virtual Microsoft.Maui.Controls.VisualElement.IsEnabledCore.get -> bool
Microsoft.Maui.Controls.VisualElement.RefreshIsEnabledProperty() -> void
override Microsoft.Maui.Controls.Button.IsEnabledCore.get -> bool
override Microsoft.Maui.Controls.ImageButton.IsEnabledCore.get -> bool
override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~Microsoft.Maui.Controls.WebView.UserAgent.get -> string
~Microsoft.Maui.Controls.WebView.UserAgent.set -> void
~override Microsoft.Maui.Controls.LayoutOptions.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender>(TSender sender, string message) -> void
Expand Down
15 changes: 15 additions & 0 deletions src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#nullable enable
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
Microsoft.Maui.Controls.Region.Equals(Microsoft.Maui.Controls.Region other) -> bool
Microsoft.Maui.Controls.Shapes.Matrix.Equals(Microsoft.Maui.Controls.Shapes.Matrix other) -> bool
override Microsoft.Maui.Controls.LayoutOptions.GetHashCode() -> int
override Microsoft.Maui.Controls.Platform.Compatibility.ShellPageRendererTracker.TitleViewContainer.LayoutSubviews() -> void
override Microsoft.Maui.Controls.Region.GetHashCode() -> int
override Microsoft.Maui.Controls.Shapes.Matrix.GetHashCode() -> int
static Microsoft.Maui.Controls.LayoutOptions.operator !=(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.LayoutOptions.operator ==(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.Region.operator !=(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Region.operator ==(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator !=(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator ==(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
~Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Microsoft.Maui.IPropertyMapper mapper) -> void
~Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Microsoft.Maui.IPropertyMapper mapper, Microsoft.Maui.CommandMapper commandMapper) -> void
override Microsoft.Maui.Controls.View.ChangeVisualState() -> void
~override Microsoft.Maui.Controls.LayoutOptions.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Platform.Compatibility.UIContainerView.AddSubview(UIKit.UIView view) -> void
~override Microsoft.Maui.Controls.Platform.Compatibility.UIContainerView.WillRemoveSubview(UIKit.UIView uiview) -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
Expand All @@ -21,6 +34,8 @@ override Microsoft.Maui.Controls.ImageButton.IsEnabledCore.get -> bool
override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~Microsoft.Maui.Controls.WebView.UserAgent.get -> string
~Microsoft.Maui.Controls.WebView.UserAgent.set -> void
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender>(TSender sender, string message) -> void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#nullable enable
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
Microsoft.Maui.Controls.Region.Equals(Microsoft.Maui.Controls.Region other) -> bool
Microsoft.Maui.Controls.Shapes.Matrix.Equals(Microsoft.Maui.Controls.Shapes.Matrix other) -> bool
override Microsoft.Maui.Controls.LayoutOptions.GetHashCode() -> int
override Microsoft.Maui.Controls.Platform.Compatibility.ShellPageRendererTracker.TitleViewContainer.LayoutSubviews() -> void
override Microsoft.Maui.Controls.Region.GetHashCode() -> int
override Microsoft.Maui.Controls.Shapes.Matrix.GetHashCode() -> int
static Microsoft.Maui.Controls.LayoutOptions.operator !=(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.LayoutOptions.operator ==(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.Region.operator !=(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Region.operator ==(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator !=(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator ==(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
~Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Microsoft.Maui.IPropertyMapper mapper) -> void
~Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Microsoft.Maui.IPropertyMapper mapper, Microsoft.Maui.CommandMapper commandMapper) -> void
override Microsoft.Maui.Controls.View.ChangeVisualState() -> void
~override Microsoft.Maui.Controls.LayoutOptions.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Platform.Compatibility.UIContainerView.AddSubview(UIKit.UIView view) -> void
~override Microsoft.Maui.Controls.Platform.Compatibility.UIContainerView.WillRemoveSubview(UIKit.UIView uiview) -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
Expand All @@ -21,6 +34,8 @@ override Microsoft.Maui.Controls.ImageButton.IsEnabledCore.get -> bool
override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~Microsoft.Maui.Controls.WebView.UserAgent.get -> string
~Microsoft.Maui.Controls.WebView.UserAgent.set -> void
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender>(TSender sender, string message) -> void
Expand Down
15 changes: 15 additions & 0 deletions src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#nullable enable
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
Microsoft.Maui.Controls.Region.Equals(Microsoft.Maui.Controls.Region other) -> bool
Microsoft.Maui.Controls.Shapes.Matrix.Equals(Microsoft.Maui.Controls.Shapes.Matrix other) -> bool
override Microsoft.Maui.Controls.LayoutOptions.GetHashCode() -> int
override Microsoft.Maui.Controls.Region.GetHashCode() -> int
override Microsoft.Maui.Controls.Shapes.Matrix.GetHashCode() -> int
static Microsoft.Maui.Controls.LayoutOptions.operator !=(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.LayoutOptions.operator ==(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.Region.operator !=(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Region.operator ==(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator !=(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator ==(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
~override Microsoft.Maui.Controls.LayoutOptions.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static Microsoft.Maui.Controls.Platform.FormattedStringExtensions.ToFormattedString(this Microsoft.Maui.Controls.Label label) -> Tizen.UIExtensions.Common.FormattedString
Microsoft.Maui.Controls.Platform.FormattedStringExtensions
*REMOVED*Microsoft.Maui.Controls.Platform.ShellView.DefaultBackgroundCorlor -> Tizen.NUI.Color!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#nullable enable
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
Microsoft.Maui.Controls.Region.Equals(Microsoft.Maui.Controls.Region other) -> bool
Microsoft.Maui.Controls.Shapes.Matrix.Equals(Microsoft.Maui.Controls.Shapes.Matrix other) -> bool
override Microsoft.Maui.Controls.LayoutOptions.GetHashCode() -> int
override Microsoft.Maui.Controls.Region.GetHashCode() -> int
override Microsoft.Maui.Controls.Shapes.Matrix.GetHashCode() -> int
static Microsoft.Maui.Controls.LayoutOptions.operator !=(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.LayoutOptions.operator ==(Microsoft.Maui.Controls.LayoutOptions left, Microsoft.Maui.Controls.LayoutOptions right) -> bool
static Microsoft.Maui.Controls.Region.operator !=(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Region.operator ==(Microsoft.Maui.Controls.Region left, Microsoft.Maui.Controls.Region right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator !=(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
static Microsoft.Maui.Controls.Shapes.Matrix.operator ==(Microsoft.Maui.Controls.Shapes.Matrix left, Microsoft.Maui.Controls.Shapes.Matrix right) -> bool
~Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Microsoft.Maui.IPropertyMapper mapper) -> void
~Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Microsoft.Maui.IPropertyMapper mapper, Microsoft.Maui.CommandMapper commandMapper) -> void
override Microsoft.Maui.Controls.View.ChangeVisualState() -> void
Expand All @@ -18,6 +30,9 @@ override Microsoft.Maui.Controls.ImageButton.IsEnabledCore.get -> bool
override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~Microsoft.Maui.Controls.WebView.UserAgent.get -> string
~Microsoft.Maui.Controls.WebView.UserAgent.set -> void
~override Microsoft.Maui.Controls.LayoutOptions.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender>(TSender sender, string message) -> void
Expand Down
Loading