C# Class Blake.NUI.WPF.Gestures.EngineHandlerBase

Base class for engine handlers.
Show file Open project: TNOCS/csTouch Class Usage Examples

Public Methods

Method Description
EngineHandlerBase ( Func engineCreator, UIElement trackedElement, bool handleTouchEvent = false ) : System

Initializes a new instance of the EngineHandler class.

StopTracking ( ) : void

Stops gesture recognition for the tracked element

Protected Methods

Method Description
CreateAndSetupGestureEngine ( System.Windows.Input.MouseDevice device ) : IGestureEngine

Creates and setups event listeners for a new gesture engine.

CreateAndSetupGestureEngine ( System.Windows.Input.TouchDevice device ) : IGestureEngine

Creates and setups event listeners for a new gesture engine.

OnGestureAborted ( IGestureEngine engine ) : void

Called when an engine aborts its gesture recognition. Typically this is done when the touch events doesn't match the engine's gesture but can it can also be aborted for other reasons.

OnGestureCompleted ( IGestureEngine engine ) : void

Called when an engine has successfully recognized a gesture.

OnGestureStarted ( IGestureEngine engine ) : void

Called when an engine starts to recognize gestures

OnStopTracking ( ) : void

Called when the TrackedElement is no longer tracked for touch events.

OnTrackedElementMouseDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
OnTrackedElementMouseMove ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
OnTrackedElementMouseUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
OnTrackedElementTouchDown ( object sender, System.Windows.Input.TouchEventArgs e ) : void

Called when a touch down event occurs on the TrackedElement.

OnTrackedElementTouchMove ( object sender, System.Windows.Input.TouchEventArgs e ) : void

Called when a touch move event occurs on the TrackedElement.

OnTrackedElementTouchUp ( object sender, System.Windows.Input.TouchEventArgs e ) : void

Called when a touch up event occurs on the TrackedElement.

TimestampToDateTime ( int timestamp ) : System.DateTime

Converts the timestamp provided in TouchEventArgs to a proper DateTime struct.

UnregisterEngine ( IGestureEngine engine ) : void

Removes all event handlers for the specified engine

Private Methods

Method Description
RaiseGestureCompleted ( UIElement element, System.Windows.Input.TouchDevice device ) : void
engine_GestureAborted ( object sender, EventArgs e ) : void
engine_GestureCompleted ( object sender, EventArgs e ) : void
engine_GestureStarted ( object sender, EventArgs e ) : void

Method Details

CreateAndSetupGestureEngine() protected method

Creates and setups event listeners for a new gesture engine.
protected CreateAndSetupGestureEngine ( System.Windows.Input.MouseDevice device ) : IGestureEngine
device System.Windows.Input.MouseDevice The touch device that caused started the potential gesture
return IGestureEngine

CreateAndSetupGestureEngine() protected method

Creates and setups event listeners for a new gesture engine.
protected CreateAndSetupGestureEngine ( System.Windows.Input.TouchDevice device ) : IGestureEngine
device System.Windows.Input.TouchDevice The touch device that caused started the potential gesture
return IGestureEngine

EngineHandlerBase() public method

Initializes a new instance of the EngineHandler class.
public EngineHandlerBase ( Func engineCreator, UIElement trackedElement, bool handleTouchEvent = false ) : System
engineCreator Func The function used to create an instance of the engine that actually recognizes the gesture.
trackedElement System.Windows.UIElement The tracked element.
handleTouchEvent bool if set to true then all touch events occurring on the tracked element will get e.Handled set to true to avoid further routing of the events.
return System

OnGestureAborted() protected method

Called when an engine aborts its gesture recognition. Typically this is done when the touch events doesn't match the engine's gesture but can it can also be aborted for other reasons.
protected OnGestureAborted ( IGestureEngine engine ) : void
engine IGestureEngine The engine that was aborted
return void

OnGestureCompleted() protected method

Called when an engine has successfully recognized a gesture.
protected OnGestureCompleted ( IGestureEngine engine ) : void
engine IGestureEngine The engine that recognized a gesture
return void

OnGestureStarted() protected method

Called when an engine starts to recognize gestures
protected OnGestureStarted ( IGestureEngine engine ) : void
engine IGestureEngine The engine that was started
return void

OnStopTracking() protected method

Called when the TrackedElement is no longer tracked for touch events.
protected OnStopTracking ( ) : void
return void

OnTrackedElementMouseDown() protected method

protected OnTrackedElementMouseDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
return void

OnTrackedElementMouseMove() protected method

protected OnTrackedElementMouseMove ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
return void

OnTrackedElementMouseUp() protected method

protected OnTrackedElementMouseUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
return void

OnTrackedElementTouchDown() protected method

Called when a touch down event occurs on the TrackedElement.
protected OnTrackedElementTouchDown ( object sender, System.Windows.Input.TouchEventArgs e ) : void
sender object The sender.
e System.Windows.Input.TouchEventArgs The instance containing the event data.
return void

OnTrackedElementTouchMove() protected method

Called when a touch move event occurs on the TrackedElement.
protected OnTrackedElementTouchMove ( object sender, System.Windows.Input.TouchEventArgs e ) : void
sender object The sender.
e System.Windows.Input.TouchEventArgs The instance containing the event data.
return void

OnTrackedElementTouchUp() protected method

Called when a touch up event occurs on the TrackedElement.
protected OnTrackedElementTouchUp ( object sender, System.Windows.Input.TouchEventArgs e ) : void
sender object The sender.
e System.Windows.Input.TouchEventArgs The instance containing the event data.
return void

StopTracking() public method

Stops gesture recognition for the tracked element
public StopTracking ( ) : void
return void

TimestampToDateTime() protected static method

Converts the timestamp provided in TouchEventArgs to a proper DateTime struct.
protected static TimestampToDateTime ( int timestamp ) : System.DateTime
timestamp int The timestamp, as received from e.TimeStamp.
return System.DateTime

UnregisterEngine() protected method

Removes all event handlers for the specified engine
protected UnregisterEngine ( IGestureEngine engine ) : void
engine IGestureEngine The engine to stop listening to
return void