Browse Source

Remove IsEmpty and Empty members

These were only removed for relevant/discussed types. Collections and some other lesser used types still have IsEmpty properties.
pull/10678/head
robloo 3 years ago
parent
commit
de4d2390d3
  1. 4
      src/Avalonia.Base/CornerRadius.cs
  2. 4
      src/Avalonia.Base/Media/BoxShadow.cs
  3. 10
      src/Avalonia.Base/PixelRect.cs
  4. 10
      src/Avalonia.Base/Rect.cs
  5. 6
      src/Avalonia.Base/Size.cs
  6. 4
      src/Avalonia.Base/Thickness.cs

4
src/Avalonia.Base/CornerRadius.cs

@ -65,10 +65,6 @@ namespace Avalonia
/// </summary>
public bool IsDefault => TopLeft == 0 && TopRight == 0 && BottomLeft == 0 && BottomRight == 0;
/// <inheritdoc cref="IsDefault"/>
[Obsolete("Use IsDefault instead.")]
public bool IsEmpty => IsDefault;
/// <summary>
/// Gets a value indicating whether all corner radii are equal.
/// </summary>

4
src/Avalonia.Base/Media/BoxShadow.cs

@ -50,10 +50,6 @@ namespace Avalonia.Media
/// </summary>
public bool IsDefault => OffsetX == 0 && OffsetY == 0 && Blur == 0 && Spread == 0;
/// <inheritdoc cref="IsDefault"/>
[Obsolete("Use IsDefault instead.")]
public bool IsEmpty => IsDefault;
private readonly static char[] s_Separator = new char[] { ' ', '\t' };
struct ArrayReader

10
src/Avalonia.Base/PixelRect.cs

@ -9,12 +9,6 @@ namespace Avalonia
/// </summary>
public readonly struct PixelRect : IEquatable<PixelRect>
{
/// <summary>
/// An empty rectangle.
/// </summary>
[Obsolete("Use the default keyword instead.")]
public static readonly PixelRect Empty = default;
/// <summary>
/// Initializes a new instance of the <see cref="PixelRect"/> structure.
/// </summary>
@ -138,10 +132,6 @@ namespace Avalonia
/// </summary>
public bool IsDefault => Width == 0 && Height == 0;
/// <inheritdoc cref="IsDefault"/>
[Obsolete("Use IsDefault instead.")]
public bool IsEmpty => IsDefault;
/// <summary>
/// Checks for equality between two <see cref="PixelRect"/>s.
/// </summary>

10
src/Avalonia.Base/Rect.cs

@ -16,12 +16,6 @@ namespace Avalonia
Animation.Animation.RegisterAnimator<RectAnimator>(prop => typeof(Rect).IsAssignableFrom(prop.PropertyType));
}
/// <summary>
/// An empty rectangle.
/// </summary>
[Obsolete("Use the default keyword instead.")]
public static readonly Rect Empty = default;
/// <summary>
/// The X position.
/// </summary>
@ -177,10 +171,6 @@ namespace Avalonia
public bool IsDefault => _width == 0 && _height == 0;
// ReSharper restore CompareOfFloatsByEqualityOperator
/// <inheritdoc cref="IsDefault"/>
[Obsolete("Use IsDefault instead.")]
public bool IsEmpty => IsDefault;
/// <summary>
/// Checks for equality between two <see cref="Rect"/>s.
/// </summary>

6
src/Avalonia.Base/Size.cs

@ -27,12 +27,6 @@ namespace Avalonia
/// </summary>
public static readonly Size Infinity = new Size(double.PositiveInfinity, double.PositiveInfinity);
/// <summary>
/// A size representing zero.
/// </summary>
[Obsolete("Use the default keyword instead.")]
public static readonly Size Empty = new Size(0, 0);
/// <summary>
/// The width.
/// </summary>

4
src/Avalonia.Base/Thickness.cs

@ -97,10 +97,6 @@ namespace Avalonia
/// </summary>
public double Bottom => _bottom;
/// <inheritdoc cref="IsDefault"/>
[Obsolete("Use IsDefault instead.")]
public bool IsEmpty => IsDefault;
/// <summary>
/// Gets a value indicating whether all sides are equal.
/// </summary>

Loading…
Cancel
Save