Ejemplo n.º 1
0
 private void detectGesture()
 {
     if (newGesturePoints.Count > 0)
     {
         // the code that you want to measure comes here
         Gesture_Event_Linking.Detect(newGesturePoints, this);
         //Gesture_Event_Copying.Detect(newGesturePoints, this);
         Gesture_Event_Sorting.Detect(newGesturePoints, this);
         //Gesture_Event_Emphasizing.Detect(newGesturePoints, this);
         //Gesture_Event_Grouping.Detect(newGesturePoints,this);
         //Gesture_Event_Sorting_Group.Detect(newGesturePoints, this);
         Gesture_Event_Showing.Detect(newGesturePoints, this);
         Gesture_Event_Showing_Sorting.Detect(newGesturePoints, this);
         Gesture_Event_Cutting_Sorting.Detect(newGesturePoints, this);
         Gesture_Event_Cutting_Link.Detect(newGesturePoints, this);
         Gesture_Event_Deleting_Bin.Detect(newGesturePoints, this);
         Gesture_Event_Collaborative_Zoon.Detect(newGesturePoints, this);
     }
 }
        public static Gesture_Event_Showing Detect(List <My_Point> points, Gesture_Controler controler)
        {
            List <My_Point> result = new List <My_Point>();

            if (points.Count > 0)
            {
                for (int i = 0; i < points.Count; i++)
                {
                    if (points[i].Life > STATICS.MIN_SHOW_LIFE && points[i].Sender is Card)
                    {
                        result.Add(points[i]);
                        for (int m = 0; m < points.Count; m++)
                        {
                            if (i != m && points[i].Sender == points[m].Sender && points[m].Life > STATICS.MIN_SHOW_LIFE)
                            {
                                result.Add(points[m]);
                            }
                        }
                        if (result.Count > 2)
                        {
                            My_Point[] argPoints = result.ToArray();
                            object[]   objects   = new object[1];
                            objects[0] = argPoints[0].Sender;
                            Gesture_Event_Showing showEvent = new Gesture_Event_Showing();
                            showEvent.Points = argPoints;
                            Gesture_List.addGesture(showEvent);
                            Gesture_Showing_Listener gestureListener = new Gesture_Showing_Listener(controler, showEvent);
                            showEvent.Register(objects, argPoints);
                            return(showEvent);
                        }
                        else
                        {
                            result.Clear();
                        }
                    }
                }
            }
            return(null);
        }
 /// <param name="gestureControler">Should be the one created in the MainWindow</param>
 /// <param name="gestureEvent">The gesture variable which fire the event</param>
 public Gesture_Showing_Listener(Gesture_Controler gestureControler, Gesture_Event_Showing gestureEvent)
     : base(gestureControler, gestureEvent)
 {
 }
 /// <param name="gestureControler">Should be the one created in the MainWindow</param>
 /// <param name="gestureEvent">The gesture variable which fire the event</param>
 public Gesture_Showing_Listener(Gesture_Controler gestureControler, Gesture_Event_Showing gestureEvent)
     : base(gestureControler, gestureEvent)
 {
 }
 private Gesture_Event_Showing detectShowingRegister(List<My_Point> points)
 {
     List<My_Point> result = new List<My_Point>();
     if (points.Count > 0)
     {
         for (int i = 0; i < points.Count; i++)
         {
             if (points[i].Life > STATICS.MIN_SHOW_LIFE && points[i].Sender is Card)
             {
                 result.Add(points[i]);
                 for (int m = 0; m < points.Count; m++)
                 {
                     if (i != m && points[i].Sender == points[m].Sender && points[m].Life > STATICS.MIN_SHOW_LIFE)
                     {
                         result.Add(points[m]);
                     }
                 }
                 if (result.Count > 2)
                 {
                     My_Point[] argPoints = result.ToArray();
                     object[] objects = new object[1];
                     objects[0] = argPoints[0].Sender;
                     Gesture_Event_Showing showEvent = new Gesture_Event_Showing();
                     showEvent.Points = argPoints;
                     Gesture_List.addGesture(showEvent);
                     Gesture_Showing_Listener gestureListener = new Gesture_Showing_Listener(this, showEvent);
                     showEvent.Register(objects, argPoints);
                     return showEvent;
                 }
                 else {
                     result.Clear();
                 }
             }
         }
     }
     return null;
 }