public static void Validate(string gestureName, string dataKey, GestureEventHandler gestureDetected = null, TouchToolkit.Framework.Components.TouchInputRecorder.GesturePlaybackCompleted playbackCompleted = null) { if (!_isInitialized) throw new FrameworkException("You must initialize the framework first!"); _storage.GetGesture(_projectname, dataKey, (projName, gesName, data, error) => { // Callback on data receive from storage if (error != null) { // Failed to retrieve data from storage if (gestureDetected != null) { GestureEventArgs e = new GestureEventArgs(); e.Error = error; gestureDetected(_layoutRoot, e); } } else { // Subscribe to the specified gesture event GestureFramework.EventManager.AddEvent(_layoutRoot, gestureName, gestureDetected); // Playback the user interaction via virtual touch provider _recorder.RunGesture(data, () => { GestureFramework.EventManager.RemoveEvent(_layoutRoot, gestureName); playbackCompleted(); }); } }); }
void EventManager_SingleTouchChanged(object sender, TouchToolkit.Framework.TouchInputProviders.SingleTouchEventArgs e) { Debug.WriteLine(e.TouchPoint.Action.ToString()); }
void _dataService_ConnectivityCheckCompleted(object sender, TouchToolkit.Framework.DataService.ConnectivityCheckCompletedEventArgs e) { if (e.Error != null) { throw new FrameworkException("Failed to connect to remote data storage"); } }
private void _dataService_AddGestureDataCompleted(object sender, TouchToolkit.Framework.DataService.AddGestureDataCompletedEventArgs e) { // Get the asyncState object that was passed while calling the async method var asyncState = e.UserState as Tuple<string, string, SaveGestureCallback>; // Notify client through the callback method asyncState.Item3(e.Result, e.Error); }
void _dataService_GetProjectsByUserCompleted(object sender, TouchToolkit.Framework.DataService.GetProjectsByUserCompletedEventArgs e) { GetAllProjectsCallback callback = e.UserState as GetAllProjectsCallback; List<ProjectDetail> projects = new List<ProjectDetail>(); if (e.Error == null) { foreach (var projectInfo in e.Result) { ProjectDetail p = new ProjectDetail() { ProjectName = projectInfo.ProjectName, GestureNames = projectInfo.GestureNames.ToList<string>() }; projects.Add(p); } callback(projects); } else { callback(null, e.Error); } }
private void _dataService_GetGestureDataCompleted(object sender, TouchToolkit.Framework.DataService.GetGestureDataCompletedEventArgs e) { // Get the asyncState object that was passed while calling the async method var asyncState = e.UserState as Tuple<string, string, GetGestureCallback>; asyncState.Item3(asyncState.Item1, asyncState.Item2, e.Result, e.Error); }
public TouchToolkit.GestureProcessor.Objects.ValidSetOfPointsCollection Validate(TouchToolkit.GestureProcessor.Objects.ValidSetOfPointsCollection sets) { throw new NotImplementedException(); }
public void Init(TouchToolkit.GestureProcessor.PrimitiveConditions.Objects.IPrimitiveConditionData ruleData) { throw new NotImplementedException(); }
public IReturnType Calculate(TouchToolkit.GestureProcessor.Objects.ValidSetOfTouchPoints set) { return new Test01ReturnType(); }