|
@@ -91,7 +91,7 @@ namespace SketchAssistantWPF
|
|
|
|
|
|
|
|
|
|
|
|
- StrokeCollection strokeCollection = new StrokeCollection();
|
|
|
+ public StrokeCollection strokeCollection = new StrokeCollection();
|
|
|
|
|
|
|
|
|
|
|
@@ -154,7 +154,7 @@ namespace SketchAssistantWPF
|
|
|
|
|
|
private void RightCanvas_MouseDown(object sender, MouseButtonEventArgs e)
|
|
|
{
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Down);
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Down, strokeCollection);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -165,16 +165,52 @@ namespace SketchAssistantWPF
|
|
|
{
|
|
|
if(strokeCollection.Count == 0)
|
|
|
{
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid);
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid, strokeCollection);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up);
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up, strokeCollection);
|
|
|
+ RightCanvas.Strokes.RemoveAt(0);
|
|
|
+ strokeCollection.RemoveAt(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private void RightCanvas_IsStylusCapturedChanged(object sender, DependencyPropertyChangedEventArgs e)
|
|
|
+ {
|
|
|
+ System.Diagnostics.Debug.WriteLine("Stylus Capture is now: {0}", RightCanvas.IsStylusCaptured);
|
|
|
+ if (!RightCanvas.IsStylusCaptured)
|
|
|
+ {
|
|
|
+ if (strokeCollection.Count == 0)
|
|
|
+ {
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid,strokeCollection);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up, strokeCollection);
|
|
|
+ RightCanvas.Strokes.RemoveAt(0);
|
|
|
+ strokeCollection.RemoveAt(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private void RightCanvas_TouchUp(object sender, TouchEventArgs e)
|
|
|
+ {
|
|
|
+ if (strokeCollection.Count == 0)
|
|
|
+ {
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid, strokeCollection);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up, strokeCollection);
|
|
|
RightCanvas.Strokes.RemoveAt(0);
|
|
|
strokeCollection.RemoveAt(0);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -587,7 +623,7 @@ namespace SketchAssistantWPF
|
|
|
debugRunning = true;
|
|
|
ProgramPresenter.Tick(); await Task.Delay(10);
|
|
|
ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Move, start);
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Down); await Task.Delay(10);
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Down, strokeCollection); await Task.Delay(10);
|
|
|
for (int x = 0; x < points.Length; x++)
|
|
|
{
|
|
|
ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Move, points[x]);
|
|
@@ -598,49 +634,9 @@ namespace SketchAssistantWPF
|
|
|
await Task.Delay(1);
|
|
|
}
|
|
|
}
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up); await Task.Delay(1);
|
|
|
+ ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up, strokeCollection); await Task.Delay(1);
|
|
|
debugRunning = false;
|
|
|
dispatcherTimer.Start();
|
|
|
}
|
|
|
-
|
|
|
- private void RightCanvas_IsStylusCapturedChanged(object sender, DependencyPropertyChangedEventArgs e)
|
|
|
- {
|
|
|
- System.Diagnostics.Debug.WriteLine("Stylus Capture is now: {0}", RightCanvas.IsStylusCaptured);
|
|
|
- if (!RightCanvas.IsStylusCaptured)
|
|
|
- {
|
|
|
- if (strokeCollection.Count == 0)
|
|
|
- {
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up);
|
|
|
- RightCanvas.Strokes.RemoveAt(0);
|
|
|
- strokeCollection.RemoveAt(0);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void RightCanvas_LostTouchCapture(object sender, TouchEventArgs e)
|
|
|
- {
|
|
|
- System.Diagnostics.Debug.WriteLine("Lost Touch Capture event");
|
|
|
- if (strokeCollection.Count == 0)
|
|
|
- {
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up);
|
|
|
- RightCanvas.Strokes.RemoveAt(0);
|
|
|
- strokeCollection.RemoveAt(0);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void RightCanvas_TouchUp(object sender, TouchEventArgs e)
|
|
|
- {
|
|
|
- System.Diagnostics.Debug.WriteLine("Touch up event");
|
|
|
- }
|
|
|
}
|
|
|
}
|