Exemplo n.º 1
0
 protected virtual void OnGestureNotRecognized(RecognitionEventArgs e)
 {
     if (GestureNotRecognized != null) GestureNotRecognized(this, e);
 }
Exemplo n.º 2
0
        protected void TouchCapture_GestureRecognized(object sender, RecognitionEventArgs e)
        {
            var touchCapture = (ITouchCapture)sender;
            // Exit if we're teaching
            if (touchCapture.Mode == CaptureMode.Training)
                return;

            // Get action to be executed
            IEnumerable<IAction> executableActions = ApplicationManager.Instance.GetRecognizedDefinedAction(e.GestureName);
            foreach (IAction executableAction in executableActions)
            {
                // Exit if there is no action configured
                if (executableAction == null || !executableAction.IsEnabled ||
                    (touchCapture.Mode == CaptureMode.UserDisabled &&
                    !"GestureSign.CorePlugins.ToggleDisableGestures".Equals(executableAction.PluginClass)))
                    continue;

                // Locate the plugin associated with this action
                IPluginInfo pluginInfo = FindPluginByClassAndFilename(executableAction.PluginClass, executableAction.PluginFilename);

                // Exit if there is no plugin available for action
                if (pluginInfo == null)
                    continue;

                // Load action settings into plugin
                pluginInfo.Plugin.Deserialize(executableAction.ActionSettings);
                // Execute plugin process
                pluginInfo.Plugin.Gestured(new PointInfo(e.LastCapturedPoints, e.Points));
            }
        }