WingMan – Diff between revs 5 and 7

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 5 Rev 7
1 using System; 1 using System;
2 using System.Collections.Generic; 2 using System.Collections.Generic;
3 using System.Linq; 3 using System.Linq;
4 using System.Text; -  
5 using System.Threading.Tasks; -  
6   4  
7 namespace WingMan 5 namespace WingMan.MouseKey
8 { 6 {
9 public class MouseKeyBinding 7 public class MouseKeyBinding : IEquatable<MouseKeyBinding>
10 { 8 {
11 public MouseKeyBinding() 9 public MouseKeyBinding()
12 { 10 {
13   -  
14 } 11 }
-   12  
15 public MouseKeyBinding(string name, List<string> keys) :this() 13 public MouseKeyBinding(string name, List<string> keys) : this()
16 { 14 {
17 Name = name; 15 Name = name;
18 Keys = keys; 16 Keys = keys;
19 } 17 }
20   18  
21 public string DisplayName => $"{Name} ({string.Join(" + ", Keys.ToArray())})"; 19 public string DisplayName => $"{Name} ({string.Join(" + ", Keys.ToArray())})";
22   20  
23 public string Name { get; set; } = string.Empty; 21 public string Name { get; set; } = string.Empty;
24   22  
25 public List<string> Keys { get; set; } = new List<string>(); 23 public List<string> Keys { get; set; } = new List<string>();
-   24  
-   25 public bool Equals(MouseKeyBinding other)
-   26 {
-   27 if (ReferenceEquals(null, other)) return false;
-   28 if (ReferenceEquals(this, other)) return true;
-   29 return string.Equals(Name, other.Name) && Keys.SequenceEqual(other.Keys);
-   30 }
-   31  
-   32 public override bool Equals(object obj)
-   33 {
-   34 if (ReferenceEquals(null, obj)) return false;
-   35 if (ReferenceEquals(this, obj)) return true;
-   36 if (obj.GetType() != GetType()) return false;
-   37 return Equals((MouseKeyBinding) obj);
-   38 }
-   39  
-   40 public override int GetHashCode()
-   41 {
-   42 unchecked
-   43 {
-   44 return ((Name != null ? Name.GetHashCode() : 0) * 397) ^ (Keys != null ? Keys.GetHashCode() : 0);
-   45 }
-   46 }
26 } 47 }
27 } 48 }
28   49