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
36 changes: 20 additions & 16 deletions src/UIKit/UIOffset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,63 @@
// Miguel de Icaza
//

// Disable until we get around to enable + fix any issues.
#nullable disable
#nullable enable

namespace UIKit {

// UIGeometry.h
/// <summary>A position offset.</summary>
/// <remarks>Represents a position offset. Positive values are to the right and down.</remarks>
/// <remarks>Represents a position offset. Positive values are to the right and down.</remarks>
public struct UIOffset {

// API match for UIOffsetZero field/constant
/// <summary>A static identity offset of 0,0.</summary>
/// <remarks>To be added.</remarks>
/// <summary>A static identity offset of (0, 0).</summary>
[Field ("UIOffsetZero")] // fake (but helps testing and could also help documentation)
public static readonly UIOffset Zero;

/// <summary>Creates a new <see cref="UIOffset" /> with the specified horizontal and vertical offsets.</summary>
/// <param name="horizontal">The horizontal offset.</param>
/// <param name="vertical">The vertical offset.</param>
public UIOffset (nfloat horizontal, nfloat vertical)
{
Horizontal = horizontal;
Vertical = vertical;
}
/// <summary>The horizontal offset.</summary>
/// <remarks>To be added.</remarks>
public /* CGFloat */ nfloat Horizontal;
/// <summary>The vertical offset.</summary>
/// <remarks>To be added.</remarks>
public /* CGFloat */ nfloat Vertical;

/// <param name="obj">To be added.</param>
/// <summary>Whether this has the same value as <paramref name="obj" />.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
public override bool Equals (object obj)
/// <summary>Determines whether this <see cref="UIOffset" /> is equal to the specified object.</summary>
/// <param name="obj">The object to compare with this instance.</param>
/// <returns><see langword="true" /> if <paramref name="obj" /> is a <see cref="UIOffset" /> with the same horizontal and vertical values; otherwise, <see langword="false" />.</returns>
public override bool Equals (object? obj)
{
if (!(obj is UIOffset))
return false;
var other = (UIOffset) obj;
return other.Horizontal == Horizontal && other.Vertical == Vertical;
}

/// <summary>The hash code for this <see cref="UIKit.UIOffset" />.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
/// <summary>Returns a hash code for this <see cref="UIOffset" />.</summary>
/// <returns>A hash code for this instance.</returns>
public override int GetHashCode ()
{
return HashCode.Combine (Horizontal, Vertical);
}

/// <summary>Determines whether two <see cref="UIOffset" /> instances are equal.</summary>
/// <param name="left">The first offset to compare.</param>
/// <param name="right">The second offset to compare.</param>
/// <returns><see langword="true" /> if the two offsets are equal; otherwise, <see langword="false" />.</returns>
public static bool operator == (UIOffset left, UIOffset right)
{
return (left.Horizontal == right.Horizontal) && (left.Vertical == right.Vertical);
}

/// <summary>Determines whether two <see cref="UIOffset" /> instances are not equal.</summary>
/// <param name="left">The first offset to compare.</param>
/// <param name="right">The second offset to compare.</param>
/// <returns><see langword="true" /> if the two offsets are not equal; otherwise, <see langword="false" />.</returns>
public static bool operator != (UIOffset left, UIOffset right)
{
return (left.Horizontal != right.Horizontal) || (left.Vertical != right.Vertical);
Expand Down
3 changes: 0 additions & 3 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17181,9 +17181,6 @@ M:UIKit.UINavigationItem.Dispose(System.Boolean)
M:UIKit.UINavigationItemRenameDelegate_Extensions.ShouldBeginRenaming(UIKit.IUINavigationItemRenameDelegate,UIKit.UINavigationItem)
M:UIKit.UINavigationItemRenameDelegate_Extensions.ShouldEndRenaming(UIKit.IUINavigationItemRenameDelegate,UIKit.UINavigationItem,System.String)
M:UIKit.UINavigationItemRenameDelegate_Extensions.WillBeginRenaming(UIKit.IUINavigationItemRenameDelegate,UIKit.UINavigationItem,System.String,Foundation.NSRange)
M:UIKit.UIOffset.#ctor(System.Runtime.InteropServices.NFloat,System.Runtime.InteropServices.NFloat)
M:UIKit.UIOffset.op_Equality(UIKit.UIOffset,UIKit.UIOffset)
M:UIKit.UIOffset.op_Inequality(UIKit.UIOffset,UIKit.UIOffset)
M:UIKit.UIPageControl.UIPageControlAppearance.#ctor(System.IntPtr)
M:UIKit.UIPageControlProgress.Dispose(System.Boolean)
M:UIKit.UIPageControlProgressDelegate_Extensions.GetInitialProgressForPage(UIKit.IUIPageControlProgressDelegate,UIKit.UIPageControlProgress,System.IntPtr)
Expand Down
Loading