diff options
Diffstat (limited to 'windows/WinUI/ZeroTierPeer.cs')
| -rw-r--r-- | windows/WinUI/ZeroTierPeer.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/windows/WinUI/ZeroTierPeer.cs b/windows/WinUI/ZeroTierPeer.cs index 06a8896b..1597cf2d 100644 --- a/windows/WinUI/ZeroTierPeer.cs +++ b/windows/WinUI/ZeroTierPeer.cs @@ -7,7 +7,7 @@ using Newtonsoft.Json; namespace WinUI { - public class ZeroTierPeer + public class ZeroTierPeer : IEquatable<ZeroTierPeer> { [JsonProperty("address")] public string Address { get; set; } @@ -57,7 +57,7 @@ namespace WinUI public int VersionMinor { get; set; } [JsonProperty("versionRev")] - public int Versionrev { get; set; } + public int VersionRev { get; set; } [JsonProperty("version")] public string Version { get; set; } @@ -94,5 +94,23 @@ namespace WinUI return pathStr; } } + + public bool Equals(ZeroTierPeer other) + { + return this.Address.Equals(other.Address, StringComparison.InvariantCultureIgnoreCase); + } + + public void Update(ZeroTierPeer other) + { + _lastUnicast = other._lastUnicast; + _lastMulticast = other._lastMulticast; + VersionMajor = other.VersionMajor; + VersionMinor = other.VersionMinor; + VersionRev = other.VersionRev; + Version = other.Version; + Latency = other.Latency; + Role = other.Role; + Paths = other.Paths; + } } } |
