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

Base class for engine handlers.
Afficher le fichier Open project: TNOCS/csTouch Class Usage Examples

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

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
Résultat IGestureEngine

CreateAndSetupGestureEngine() protected méthode

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
Résultat IGestureEngine

EngineHandlerBase() public méthode

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.
Résultat System

OnGestureAborted() protected méthode

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
Résultat void

OnGestureCompleted() protected méthode

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

OnGestureStarted() protected méthode

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

OnStopTracking() protected méthode

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

OnTrackedElementMouseDown() protected méthode

protected OnTrackedElementMouseDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
Résultat void

OnTrackedElementMouseMove() protected méthode

protected OnTrackedElementMouseMove ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
Résultat void

OnTrackedElementMouseUp() protected méthode

protected OnTrackedElementMouseUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
Résultat void

OnTrackedElementTouchDown() protected méthode

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.
Résultat void

OnTrackedElementTouchMove() protected méthode

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.
Résultat void

OnTrackedElementTouchUp() protected méthode

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.
Résultat void

StopTracking() public méthode

Stops gesture recognition for the tracked element
public StopTracking ( ) : void
Résultat void

TimestampToDateTime() protected static méthode

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.
Résultat System.DateTime

UnregisterEngine() protected méthode

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