Example #1
0
        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();
                        });

                    }
                });
        }
Example #2
0
 void EventManager_SingleTouchChanged(object sender, TouchToolkit.Framework.TouchInputProviders.SingleTouchEventArgs e)
 {
     Debug.WriteLine(e.TouchPoint.Action.ToString());
 }
Example #3
0
 void _dataService_ConnectivityCheckCompleted(object sender, TouchToolkit.Framework.DataService.ConnectivityCheckCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         throw new FrameworkException("Failed to connect to remote data storage");
     }
 }
Example #4
0
        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);
        }
Example #5
0
        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);
            }
        }
Example #6
0
        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);
        }
Example #7
0
 public TouchToolkit.GestureProcessor.Objects.ValidSetOfPointsCollection Validate(TouchToolkit.GestureProcessor.Objects.ValidSetOfPointsCollection sets)
 {
     throw new NotImplementedException();
 }
Example #8
0
 public void Init(TouchToolkit.GestureProcessor.PrimitiveConditions.Objects.IPrimitiveConditionData ruleData)
 {
     throw new NotImplementedException();
 }
Example #9
0
 public IReturnType Calculate(TouchToolkit.GestureProcessor.Objects.ValidSetOfTouchPoints set)
 {
     return new Test01ReturnType();
 }