-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from emoacht/develop
Develop
- Loading branch information
Showing
16 changed files
with
746 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ public enum AccessStatus | |
Succeeded, | ||
Failed, | ||
DdcFailed, | ||
TransmissionFailed, | ||
NoLongerExist | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace Monitorian.Core.Views.Touchpad | ||
{ | ||
internal struct TouchpadContact : IEquatable<TouchpadContact> | ||
{ | ||
public int ContactId { get; } | ||
public int X { get; } | ||
public int Y { get; } | ||
|
||
public Point Point => new(X, Y); | ||
|
||
public TouchpadContact(int contactId, int x, int y) => | ||
(this.ContactId, this.X, this.Y) = (contactId, x, y); | ||
|
||
public override bool Equals(object obj) => (obj is TouchpadContact other) && Equals(other); | ||
|
||
public bool Equals(TouchpadContact other) => | ||
(this.ContactId == other.ContactId) && (this.X == other.X) && (this.Y == other.Y); | ||
|
||
public static bool operator ==(TouchpadContact a, TouchpadContact b) => a.Equals(b); | ||
public static bool operator !=(TouchpadContact a, TouchpadContact b) => !a.Equals(b); | ||
|
||
public override int GetHashCode() => (this.ContactId, this.X, this.Y).GetHashCode(); | ||
|
||
public override string ToString() => $"Contact ID:{ContactId} Point:{X},{Y}"; | ||
} | ||
|
||
internal class TouchpadContactCreator | ||
{ | ||
public int? ContactId { get; set; } | ||
public int? X { get; set; } | ||
public int? Y { get; set; } | ||
|
||
public bool TryCreate(out TouchpadContact contact) | ||
{ | ||
if (ContactId.HasValue && X.HasValue && Y.HasValue) | ||
{ | ||
contact = new TouchpadContact(ContactId.Value, X.Value, Y.Value); | ||
return true; | ||
} | ||
contact = default; | ||
return false; | ||
} | ||
|
||
public void Clear() | ||
{ | ||
ContactId = null; | ||
X = null; | ||
Y = null; | ||
} | ||
} | ||
} |
Oops, something went wrong.