WingMan – Diff between revs 14 and 24

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