diff options
| author | Jacob Palecki <[email protected]> | 2020-09-01 02:18:41 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-01 02:18:41 -0700 |
| commit | 246fb772c5bf7dd6a85143fadebece3b4d9f1e04 (patch) | |
| tree | 454c869d44c69a0e7603ceb1e03de8a3e4f5e70a /grapher/Models/Mouse | |
| parent | Show xy charts only when accel applied by component (diff) | |
| download | rawaccel-246fb772c5bf7dd6a85143fadebece3b4d9f1e04.tar.xz rawaccel-246fb772c5bf7dd6a85143fadebece3b4d9f1e04.zip | |
Add constants class and separate classes into regions
Diffstat (limited to 'grapher/Models/Mouse')
| -rw-r--r-- | grapher/Models/Mouse/MouseWatcher.cs | 15 | ||||
| -rw-r--r-- | grapher/Models/Mouse/PointData.cs | 12 |
2 files changed, 27 insertions, 0 deletions
diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index fea4e2d..6f6b776 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -11,6 +11,7 @@ namespace grapher.Models.Mouse { public class MouseWatcher { + #region External /// <summary> /// Enumeration containing HID usage page flags. /// </summary> @@ -677,6 +678,10 @@ namespace grapher.Models.Mouse [DllImport("user32.dll")] public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RawInput pData, ref int pcbSize, int cbSizeHeader); + #endregion External + + #region Constructors + public MouseWatcher(Form containingForm, Label display, AccelCharts accelCharts) { ContainingForm = containingForm; @@ -695,6 +700,10 @@ namespace grapher.Models.Mouse PollTime = 1; } + #endregion Constructors + + #region Properties + private Form ContainingForm { get; } private Label Display { get; } @@ -703,6 +712,10 @@ namespace grapher.Models.Mouse private double PollTime { get; } + #endregion Properties + + #region Methods + public void OnMouseMove(int x, int y, double timeInMs) { Display.Text = $"Last (x, y): ({x}, {y})"; @@ -723,5 +736,7 @@ namespace grapher.Models.Mouse } } + + #endregion Methods } } diff --git a/grapher/Models/Mouse/PointData.cs b/grapher/Models/Mouse/PointData.cs index 12a6e73..3641c23 100644 --- a/grapher/Models/Mouse/PointData.cs +++ b/grapher/Models/Mouse/PointData.cs @@ -8,6 +8,8 @@ namespace grapher.Models.Mouse { public class PointData { + #region Constructors + public PointData() { Lock = new Object(); @@ -15,6 +17,10 @@ namespace grapher.Models.Mouse Y = new double[] { 0 }; } + #endregion Constructors + + #region Properties + public Object Lock { get; } private double[] X { get; set; } @@ -29,6 +35,10 @@ namespace grapher.Models.Mouse } } + #endregion Properties + + #region Methods + public void Get(out double[] x, out double[] y) { lock(Lock) @@ -37,5 +47,7 @@ namespace grapher.Models.Mouse y = Y; } } + + #endregion Methods } } |