diff options
| author | a1xd <[email protected]> | 2020-10-08 23:12:08 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-10-08 23:12:08 -0400 |
| commit | f4c04b4eb03fdbf1f3402dfb26e891ce8d968c9f (patch) | |
| tree | 2da2e0e956c8b92c24260ec9ed4fa3f0681c0a1a /grapher/Models/Serialized/GUISettings.cs | |
| parent | Fixed anisotropy not loading correctly on save (diff) | |
| parent | add magic number to constants (diff) | |
| download | rawaccel-1.1.0.tar.xz rawaccel-1.1.0.zip | |
Merge pull request #33 from a1xd/1.1v1.1.0
1.1
Diffstat (limited to 'grapher/Models/Serialized/GUISettings.cs')
| -rw-r--r-- | grapher/Models/Serialized/GUISettings.cs | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/grapher/Models/Serialized/GUISettings.cs b/grapher/Models/Serialized/GUISettings.cs index 84e681b..c8f87ae 100644 --- a/grapher/Models/Serialized/GUISettings.cs +++ b/grapher/Models/Serialized/GUISettings.cs @@ -10,32 +10,55 @@ namespace grapher.Models.Serialized public GUISettings() {} - public GUISettings(bool autoWrite, int dpi, int pollRate) - { - AutoWriteToDriverOnStartup = autoWrite; - DPI = dpi; - PollRate = pollRate; - } - #endregion Constructors #region Properties - [JsonProperty(Order = 1)] - public bool AutoWriteToDriverOnStartup { get; set; } - [JsonProperty(Order = 2)] + [JsonProperty(Order = 1)] public int DPI { get; set; } - [JsonProperty(Order = 3)] + [JsonProperty(Order = 2)] public int PollRate { get; set; } - [JsonProperty(Order = 4)] + [JsonProperty(Order = 3)] public bool ShowLastMouseMove { get; set; } [JsonProperty(Order = 4)] public bool ShowVelocityAndGain { get; set; } #endregion Properties + + #region Methods + + public override bool Equals(object obj) + { + var other = obj as GUISettings; + + if (other == null) + { + return false; + } + + return Equals(other); + } + + public bool Equals(GUISettings other) + { + return DPI == other.DPI && + PollRate == other.PollRate && + ShowLastMouseMove == other.ShowLastMouseMove && + ShowVelocityAndGain == other.ShowVelocityAndGain; + } + + public override int GetHashCode() + { + return DPI.GetHashCode() ^ + PollRate.GetHashCode() ^ + ShowLastMouseMove.GetHashCode() ^ + ShowVelocityAndGain.GetHashCode(); + } + + #endregion Methods } } |