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);
     }
 }
Example #2
0
        public static Gesture_Event_Deleting_Bin Detect(List <My_Point> points, Gesture_Controler controler)
        {
            List <My_Point>            result        = new List <My_Point>();
            Gesture_Event_Deleting_Bin deletingEvent = null;

            foreach (My_Point p in points)
            {
                if (!result.Contains(p) && p.Sender is Menu_Sort_Box)
                {
                    Menu_Sort_Box category = p.Sender as Menu_Sort_Box;
                    foreach (Menu_Container mc in controler.Control.MainWindow.MenuLayer.MenuBars)
                    {
                        if (mc != null && category != null && Math.Sqrt(Math.Pow((category.CurrentPosition.X - mc.RecycleButton.XCoord), 2) +
                                                                        Math.Pow((category.CurrentPosition.Y - mc.RecycleButton.YCoord), 2))
                            < 50)
                        {
                            mc.displayRecycleNotification();
                            foreach (My_Point p2 in points)
                            {
                                if (p.Sender == p2.Sender && !result.Contains(p2))
                                {
                                    result.Add(p2);
                                }
                            }
                            My_Point[] argPoints = result.ToArray();
                            object[]   objects   = new object[2];
                            objects[0]    = category;
                            objects[1]    = mc.RecycleButton;
                            deletingEvent = new Gesture_Event_Deleting_Bin();
                            Gesture_List.addGesture(deletingEvent);
                            Gesture_Deleting_Bin_Listener gestureListener = new Gesture_Deleting_Bin_Listener(controler, deletingEvent);
                            deletingEvent.Register(objects, argPoints);
                        }
                        else if (mc != null)
                        {
                            mc.removeRecycleNotification();
                        }
                    }
                }
            }
            return(deletingEvent);
        }
        public static Gesture_Event_Deleting_Bin Detect(List<My_Point> points, Gesture_Controler controler)
        {
            List<My_Point> result = new List<My_Point>();
            Gesture_Event_Deleting_Bin deletingEvent = null;
            foreach (My_Point p in points)
            {
                if (!result.Contains(p) && p.Sender is Menu_Sort_Box)
                {
                    Menu_Sort_Box category = p.Sender as Menu_Sort_Box;
                    foreach (Menu_Container mc in controler.Control.MainWindow.MenuLayer.MenuBars)
                    {
                        if (mc != null && category != null && Math.Sqrt(Math.Pow((category.CurrentPosition.X - mc.RecycleButton.XCoord), 2) +
                            Math.Pow((category.CurrentPosition.Y - mc.RecycleButton.YCoord), 2))
                            < 50)
                        {
                            mc.displayRecycleNotification();
                            foreach (My_Point p2 in points)
                            {
                                if (p.Sender == p2.Sender && !result.Contains(p2))
                                    result.Add(p2);
                            }
                            My_Point[] argPoints = result.ToArray();
                            object[] objects = new object[2];
                            objects[0] = category;
                            objects[1] = mc.RecycleButton;
                            deletingEvent = new Gesture_Event_Deleting_Bin();
                            Gesture_List.addGesture(deletingEvent);
                            Gesture_Deleting_Bin_Listener gestureListener = new Gesture_Deleting_Bin_Listener(controler, deletingEvent);
                            deletingEvent.Register(objects, argPoints);
                        }
                        else if (mc != null)
                        {
                            mc.removeRecycleNotification();
                        }
                    }

                }
            }
            return deletingEvent;
        }
 public Gesture_Deleting_Bin_Listener(Gesture_Controler gestureControler, Gesture_Event_Deleting_Bin gestureEvent)
     : base(gestureControler, gestureEvent)
 {
 }
 public Gesture_Deleting_Bin_Listener(Gesture_Controler gestureControler, Gesture_Event_Deleting_Bin gestureEvent)
     : base(gestureControler, gestureEvent)
 {
 }