Beispiel #1
0
 public override void Terminate(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null)
     {
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints = myPoints;
         My_Point point = myPoints[0];
         foreach (Card card in Card_List.CardList)
         {
             if (card.Contain(point.CurrentPoint.Position))
             {
                 Senders[1] = card;
                 card2      = card;
                 break;
             }
             else
             {
                 this.Senders = senders;
             }
         }
         gestureEventArgs.GestureObjects = this.Senders;
         this.Status = GESTURESTATUS.TERMINATE;
         OnTerminated(this, gestureEventArgs);
     }
 }
Beispiel #2
0
        public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Gesture_Event_Linking gesture = sender as Gesture_Event_Linking;

            gestureControler.Control.MainWindow.LinkingGestureLayer.Add(gesture);
            base.RegisterGesture(sender, gEventArgs);
        }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Gesture_Event_Linking link = gEventArgs.Senders[0] as Gesture_Event_Linking;
     Link_List.RemoveLink(link);
     gestureControler.MainWindow.LinkingGestureLayer.Remove(link);
     base.TerminateGesture(sender, gEventArgs);
 }
 public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     News_Card card = sender as News_Card;
     Shared_Card_List.UpdateSharedCards();
     gestureControler.Control.CloudControler.UpdateMatrix();
     base.FailGesture(sender, gEventArgs);
 }
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Menu_Sort_Box box = gEventArgs.GestureObjects[0] as Menu_Sort_Box;

            gestureControler.Control.SortingBoxControler.DeleteGroup(box);
            base.TerminateGesture(sender, gEventArgs);
        }
        public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Menu_Sort_Box b = gEventArgs.GestureObjects[0] as Menu_Sort_Box;

            gestureControler.Control.MainWindow.SortingGestureLayer.RemoveLines(b);
            base.FailGesture(sender, gEventArgs);
        }
 public override void Continue(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null && checkValid(null, null))
     {
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints = myPoints;
         gestureEventArgs.Senders = senders;
         this.Status = GESTURESTATUS.CONTINUE;
         double xAvg = 0;
         double yAvg = 0;
         for (int i = 0; i < 4; i++) {
             xAvg += myPoints[i].CurrentPoint.Position.X - previousPoint[i].X;
             yAvg += myPoints[i].CurrentPoint.Position.Y - previousPoint[i].Y;
             previousPoint[i] = new Point(myPoints[i].CurrentPoint.Position.X, myPoints[i].CurrentPoint.Position.Y);
         }
         xAvg = xAvg / 4;
         yAvg = yAvg / 4;
         vector = new Vector(xAvg, yAvg);
         vectorDistance.X += xAvg;
         vectorDistance.Y += yAvg;
         OnContinued(this, gestureEventArgs);
     }
     if (!checkValid(null,null))
     {
         Fail();
         return;
     }
     if (checkTerminate(null, null))
     {
         Terminate(senders, myPoints);
     }
 }
 public override void Continue(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null && checkValid(null, null))
     {
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints  = myPoints;
         gestureEventArgs.GestureObjects = senders;
         this.Status = GESTURESTATUS.CONTINUE;
         double xAvg = 0;
         double yAvg = 0;
         for (int i = 0; i < 4; i++)
         {
             xAvg            += myPoints[i].CurrentPoint.Position.X - previousPoint[i].X;
             yAvg            += myPoints[i].CurrentPoint.Position.Y - previousPoint[i].Y;
             previousPoint[i] = new Point(myPoints[i].CurrentPoint.Position.X, myPoints[i].CurrentPoint.Position.Y);
         }
         xAvg              = xAvg / 4;
         yAvg              = yAvg / 4;
         vector            = new Vector(xAvg, yAvg);
         vectorDistance.X += xAvg;
         vectorDistance.Y += yAvg;
         OnContinued(this, gestureEventArgs);
     }
     if (!checkValid(null, null))
     {
         Fail();
         return;
     }
     if (checkTerminate(null, null))
     {
         Terminate(senders, myPoints);
     }
 }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     News_Card card = gEventArgs.GestureObjects[0] as News_Card;
     Shared_Card_List.UpdateSharedCards();
     gestureControler.Control.CloudControler.UpdateMatrix();
     base.TerminateGesture(sender, gEventArgs);
 }
 public override void Fail()
 {
     Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
     gestureEventArgs.GesturePoints = Points;
     gestureEventArgs.GestureObjects = Senders;
     this.Status = GESTURESTATUS.FAIL;
     OnFailed(this, gestureEventArgs);
 }
Beispiel #11
0
 public virtual void FailGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     gestureEvent.Registered -= registerHandler;
     gestureEvent.Continued  -= continueHandler;
     gestureEvent.Terminated -= terminateHandler;
     gestureEvent.Failed     -= failHandler;
     Record_Helper.PrintRecord(gestureControler.Control.MainWindow, gestureEvent, gEventArgs, GESTURESTATUS.FAIL);
 }
Beispiel #12
0
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Gesture_Event_Linking link = gEventArgs.GestureObjects[0] as Gesture_Event_Linking;

            Link_List.RemoveLink(link);
            gestureControler.Control.MainWindow.LinkingGestureLayer.Remove(link);
            base.TerminateGesture(sender, gEventArgs);
        }
 public virtual void FailGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     gestureEvent.Registered -= registerHandler;
     gestureEvent.Continued -= continueHandler;
     gestureEvent.Terminated -= terminateHandler;
     gestureEvent.Failed -= failHandler;
     Record_Helper.PrintRecord(gestureControler.MainWindow, gestureEvent, gEventArgs, GESTURESTATUS.FAIL);
 }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Card c = gEventArgs.GestureObjects[1] as Card;
     Menu_Sort_Box b = gEventArgs.GestureObjects[0] as Menu_Sort_Box;
     Group_List.RemoveCard(b, c);
     gestureControler.Control.MainWindow.SortingGestureLayer.Repaint();
     base.TerminateGesture(sender, gEventArgs);
 }
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            News_Card card = gEventArgs.GestureObjects[0] as News_Card;

            Shared_Card_List.UpdateSharedCards();
            gestureControler.Control.CloudControler.UpdateMatrix();
            base.TerminateGesture(sender, gEventArgs);
        }
        public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            News_Card card = sender as News_Card;

            Shared_Card_List.UpdateSharedCards();
            gestureControler.Control.CloudControler.UpdateMatrix();
            base.FailGesture(sender, gEventArgs);
        }
 protected virtual void OnTerminated(object sender, Gesture_Event_Args gEventArgs)
 {
     foreach (My_Point point in gEventArgs.GesturePoints)
     {
         Point_List.ReleasePoint(point.ID);
     }
     Terminated(sender, gEventArgs);
 }
 public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     foreach (Card c in gEventArgs.GestureObjects)
     {
         c.Hightlight();
     }
     gestureControler.Control.MainWindow.GroupingGestureLayer.Add(sender as Gesture_Event_Grouping);
     base.RegisterGesture(sender, gEventArgs);
 }
Beispiel #19
0
 public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     foreach (Card c in gEventArgs.GestureObjects)
     {
         c.Dehightlight();
     }
     gestureControler.Control.MainWindow.GroupingGestureLayer.Remove(sender as Gesture_Event_Grouping);
     base.FailGesture(sender, gEventArgs);
 }
        public override void Fail()
        {
            Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();

            gestureEventArgs.GesturePoints  = Points;
            gestureEventArgs.GestureObjects = Senders;
            this.Status = GESTURESTATUS.FAIL;
            OnFailed(this, gestureEventArgs);
        }
Beispiel #21
0
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Card          c = gEventArgs.GestureObjects[1] as Card;
            Menu_Sort_Box b = gEventArgs.GestureObjects[0] as Menu_Sort_Box;

            Group_List.RemoveCard(b, c);
            gestureControler.Control.MainWindow.SortingGestureLayer.Repaint();
            base.TerminateGesture(sender, gEventArgs);
        }
 public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     foreach (Card c in gEventArgs.Senders)
     {
         c.Dehightlight();
     }
     gestureControler.MainWindow.GroupingGestureLayer.Remove(sender as Gesture_Event_Grouping);
     base.FailGesture(sender, gEventArgs);
 }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Card c = gEventArgs.GestureObjects[0] as Card;
     double newsize = (sender as Gesture_Event_Emphasizing).GetSize();
     double oldsize = (sender as Gesture_Event_Emphasizing).StartSize;
     if (newsize < oldsize) {
         c.ResetBrightness();
     }
     base.TerminateGesture(sender,gEventArgs);
 }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     foreach (Card c in gEventArgs.GestureObjects)
     {
         gestureControler.Control.MainWindow.LinkingGestureLayer.Move(c);
         c.Dehightlight();
     }
     gestureControler.Control.MainWindow.GroupingGestureLayer.Remove(sender as Gesture_Event_Grouping);
     base.TerminateGesture(sender, gEventArgs);
 }
 public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Menu_Sort_Box b = gEventArgs.GestureObjects[1] as Menu_Sort_Box;
     if (Group_List.CardGroups.ContainsKey(b) && !gestureControler.Control.MainWindow.MenuLayer.IsButtonInOriginPos(b))
     {
         Card[] cards = Group_List.CardGroups[b].ToArray();
         foreach (Card c in cards) { c.Hightlight(Colors.Gold); }
     }
     base.RegisterGesture(sender, gEventArgs);
 }
 public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Card card=gEventArgs.GestureObjects[0] as Card;
     Card card2 = gestureControler.Control.MainWindow.Controlers.CardControler.CopyCard(card);
     if (card2 != null) {
         gEventArgs.GestureObjects[1] = card2;
     }
     lastPosi = gEventArgs.GesturePoints[0].CurrentPoint.Position;
     base.RegisterGesture(sender, gEventArgs);
 }
 public override void Terminate(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null)
     {
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints  = myPoints;
         gestureEventArgs.GestureObjects = senders;
         this.Status = GESTURESTATUS.TERMINATE;
         OnTerminated(this, gestureEventArgs);
     }
 }
        public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Menu_Sort_Box b = gEventArgs.GestureObjects[1] as Menu_Sort_Box;

            if (Group_List.CardGroups.ContainsKey(b))
            {
                Card[] cards = Group_List.CardGroups[b].ToArray();
                foreach (Card c in cards) { c.Dehightlight(); }
            }
            base.FailGesture(sender, gEventArgs);
        }
 public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     if(gEventArgs.GestureObjects.Length>1){
         Card card2 = gEventArgs.GestureObjects[0] as Card;
         card2.MoveCard(gEventArgs.GesturePoints[0].CurrentPoint.Position.X - lastPosi.X,
             gEventArgs.GesturePoints[0].CurrentPoint.Position.Y - lastPosi.Y,
             0);
         lastPosi = gEventArgs.GesturePoints[0].CurrentPoint.Position;
     }
     base.ContinueGesture(sender, gEventArgs);
 }
 public override void Terminate(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null)
     {
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints = myPoints;
         gestureEventArgs.Senders = senders;
         this.Status = GESTURESTATUS.TERMINATE;
         OnTerminated(this, gestureEventArgs);
     }
 }
        public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Card card  = gEventArgs.GestureObjects[0] as Card;
            Card card2 = gestureControler.Control.MainWindow.Controlers.CardControler.CopyCard(card);

            if (card2 != null)
            {
                gEventArgs.GestureObjects[1] = card2;
            }
            lastPosi = gEventArgs.GesturePoints[0].CurrentPoint.Position;
            base.RegisterGesture(sender, gEventArgs);
        }
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Card   c       = gEventArgs.GestureObjects[0] as Card;
            double newsize = (sender as Gesture_Event_Emphasizing).GetSize();
            double oldsize = (sender as Gesture_Event_Emphasizing).StartSize;

            if (newsize < oldsize)
            {
                c.ResetBrightness();
            }
            base.TerminateGesture(sender, gEventArgs);
        }
 public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     if (gEventArgs.GestureObjects.Length > 1)
     {
         Card card2 = gEventArgs.GestureObjects[0] as Card;
         card2.MoveCard(gEventArgs.GesturePoints[0].CurrentPoint.Position.X - lastPosi.X,
                        gEventArgs.GesturePoints[0].CurrentPoint.Position.Y - lastPosi.Y,
                        0);
         lastPosi = gEventArgs.GesturePoints[0].CurrentPoint.Position;
     }
     base.ContinueGesture(sender, gEventArgs);
 }
 public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Card card = gEventArgs.Senders[0] as Card;
     foreach (Card c in Card_List.CardList) {
         if (c != card) {
             if (c.UID == card.UID) {
                 c.Hightlight();
             }
         }
     }
     base.RegisterGesture(sender, gEventArgs);
 }
 public override void Register(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null)
     {
         Points  = myPoints;
         Senders = senders;
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints  = myPoints;
         gestureEventArgs.GestureObjects = senders;
         this.Status = GESTURESTATUS.REGISTER;
         OnRegistered(this, gestureEventArgs);
     }
 }
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Gesture_Event_Linking gesture = sender as Gesture_Event_Linking;
            if (gEventArgs.GestureObjects != null && gEventArgs.GestureObjects[1] != null)
            {
                gestureControler.Control.MainWindow.LinkingGestureLayer.Move(gesture);
            }
            else {
                gestureControler.Control.MainWindow.LinkingGestureLayer.Remove(gesture);
            }

            base.TerminateGesture(sender, gEventArgs);
        }
 public override void Register(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null)
     {
         Points = myPoints;
         Senders = senders;
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints = myPoints;
         gestureEventArgs.GestureObjects = senders;
         this.Status = GESTURESTATUS.REGISTER;
         OnRegistered(this, gestureEventArgs);
     }
 }
        public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Menu_Sort_Box b = gEventArgs.GestureObjects[1] as Menu_Sort_Box;

            if (Group_List.CardGroups.ContainsKey(b))
            {
                Card[] cards = Group_List.CardGroups[b].ToArray();
                foreach (Card c in cards)
                {
                    c.Dehightlight();
                }
            }
            base.FailGesture(sender, gEventArgs);
        }
 public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Card c = gEventArgs.GestureObjects[0] as Card;
     double newsize = (sender as Gesture_Event_Emphasizing).GetSize();
     double oldsize = (sender as Gesture_Event_Emphasizing).StartSize;
     if (newsize != oldsize)
     {
         c.ChangeBrightness(newsize, oldsize);
     }
     else {
         return;
     }
     base.ContinueGesture(sender,gEventArgs);
 }
 public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Gesture_Event_Grouping gesture = sender as Gesture_Event_Grouping;
     Card[] cards = gEventArgs.GestureObjects as Card[];
     if (!gesture.IsGrouping())
     {
         foreach (Card c in cards)
         {
             c.MoveCard(gesture.Vector.X, gesture.Vector.Y, 0);
         }
         gestureControler.Control.MainWindow.GroupingGestureLayer.Remove(gesture);
     }
     base.ContinueGesture(sender, gEventArgs);
 }
        public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Menu_Sort_Box b = gEventArgs.GestureObjects[1] as Menu_Sort_Box;

            if (Group_List.CardGroups.ContainsKey(b) && !gestureControler.Control.MainWindow.MenuLayer.IsButtonInOriginPos(b))
            {
                Card[] cards = Group_List.CardGroups[b].ToArray();
                foreach (Card c in cards)
                {
                    c.Hightlight(Colors.Gold);
                }
            }
            base.RegisterGesture(sender, gEventArgs);
        }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Card card = gEventArgs.GestureObjects[0] as Card;
     foreach (Card c in Card_List.CardList)
     {
         if (c != card)
         {
             if (c.UUID == card.UUID)
             {
                 c.Dehightlight();
             }
         }
     }
     base.TerminateGesture(sender, gEventArgs);
 }
Beispiel #43
0
        public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Gesture_Event_Grouping gesture = sender as Gesture_Event_Grouping;

            Card[] cards = gEventArgs.GestureObjects as Card[];
            if (!gesture.IsGrouping())
            {
                foreach (Card c in cards)
                {
                    c.MoveCard(gesture.Vector.X, gesture.Vector.Y, 0);
                }
                gestureControler.Control.MainWindow.GroupingGestureLayer.Remove(gesture);
            }
            base.ContinueGesture(sender, gEventArgs);
        }
Beispiel #44
0
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Gesture_Event_Linking gesture = sender as Gesture_Event_Linking;

            if (gEventArgs.GestureObjects != null && gEventArgs.GestureObjects[1] != null)
            {
                gestureControler.Control.MainWindow.LinkingGestureLayer.Move(gesture);
            }
            else
            {
                gestureControler.Control.MainWindow.LinkingGestureLayer.Remove(gesture);
            }

            base.TerminateGesture(sender, gEventArgs);
        }
        public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Card   c       = gEventArgs.GestureObjects[0] as Card;
            double newsize = (sender as Gesture_Event_Emphasizing).GetSize();
            double oldsize = (sender as Gesture_Event_Emphasizing).StartSize;

            if (newsize != oldsize)
            {
                c.ChangeBrightness(newsize, oldsize);
            }
            else
            {
                return;
            }
            base.ContinueGesture(sender, gEventArgs);
        }
        public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Card card = gEventArgs.GestureObjects[0] as Card;

            foreach (Card c in Card_List.CardList)
            {
                if (c != card)
                {
                    if (c.UUID == card.UUID)
                    {
                        c.Hightlight();
                    }
                }
            }
            base.RegisterGesture(sender, gEventArgs);
        }
        public static String PrintRecord(MainWindow mainWindow, Gesture_Event gesture, Gesture_Event_Args args, GESTURESTATUS status)
        {
            String oneRecord = "";
            if (STATICS.DEBUG_MODE)
            {
                RecordObj rObj = new RecordObj();
                oneRecord += DateTime.Now.ToString("h:mm:ss:fff tt");
                rObj.time_stemp = DateTime.Now.ToString("h:mm:ss:fff tt");

                oneRecord += "$"+gesture.GetType().Name.ToString();
                rObj.gesture_name=gesture.GetType().Name.ToString();

                oneRecord += "$" + status.ToString();
                rObj.status = status.ToString();

                List<String> cards = new List<string>();
                List<String> buttons = new List<string>();
                foreach (object obj in args.GestureObjects) {
                    if (obj is Card) {
                        Card c = obj as Card;
                        oneRecord += "$" + "Card={" + c.Owner + "," + c.UUID + ","  + "}";
                        cards.Add(c.Owner + "," + c.UUID + ",");
                    }
                    else if (obj is Menu_Sort_Box) {
                        Menu_Sort_Box b = obj as Menu_Sort_Box;
                        oneRecord += "$" + "Button={" + b.GroupID + "," + b.GroupText + "}";
                        buttons.Add(b.GroupID + "," + b.GroupText);
                    }
                }
                rObj.cards = cards.ToArray();
                rObj.buttons = buttons.ToArray();

                List<String> points = new List<string>();
                int index = 0;
                foreach (My_Point point in args.GesturePoints) {
                    oneRecord += "$" + "Point={" + index + "," + "[" + point.StartTime.ToString("h:mm:ss:fff tt") +","+ point.StartPoint.Position.ToString() + "]"
                        + "," + "[" +DateTime.Now.ToString("h:mm:ss:fff tt")+","+ point.CurrentPoint.Position.ToString() + "]" + "}";
                    points.Add(point.StartTime.ToString("h:mm:ss:fff tt") + "," + point.StartPoint.Position.ToString()+","+
                        DateTime.Now.ToString("h:mm:ss:fff tt") + "," + point.CurrentPoint.Position.ToString());
                    index++;
                }
                rObj.points = points.ToArray();
                mainWindow.ControlWindow.SaveRecord(rObj);
                mainWindow.ControlWindow.UpdateTextInfo(oneRecord, 2);
            }
            return oneRecord;
        }
Beispiel #48
0
        public override void Terminate(object[] senders, My_Point[] myPoints)
        {
            if (myPoints != null && senders != null)
            {
                Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
                gestureEventArgs.GesturePoints  = myPoints;
                gestureEventArgs.GestureObjects = senders;
                this.Status = GESTURESTATUS.TERMINATE;
                OnTerminated(this, gestureEventArgs);
            }
            Menu_Recycle_Bin mc = senders[1] as Menu_Recycle_Bin;

            if (mc != null)
            {
                mc.Mc.removeRecycleNotification();
            }
        }
 public override void Register(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null)
     {
         Points  = myPoints;
         Senders = senders;
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints  = myPoints;
         gestureEventArgs.GestureObjects = senders;
         this.Status = GESTURESTATUS.REGISTER;
         for (int i = 0; i < 4; i++)
         {
             previousPoint[i] = new Point(myPoints[i].CurrentPoint.Position.X, myPoints[i].CurrentPoint.Position.Y);
         }
         OnRegistered(this, gestureEventArgs);
     }
 }
 public override void Register(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null)
     {
         Points = myPoints;
         Senders = senders;
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints = myPoints;
         gestureEventArgs.Senders = senders;
         this.Status = GESTURESTATUS.REGISTER;
         for (int i = 0; i < 4; i++)
         {
             previousPoint[i] = new Point(myPoints[i].CurrentPoint.Position.X, myPoints[i].CurrentPoint.Position.Y);
         }
         OnRegistered(this, gestureEventArgs);
     }
 }
Beispiel #51
0
 public override void Continue(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null && checkValid(null, null))
     {
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints  = myPoints;
         gestureEventArgs.GestureObjects = senders;
         this.Status = GESTURESTATUS.CONTINUE;
         OnContinued(this, gestureEventArgs);
     }
     if (!checkValid(null, null))
     {
         Fail();
         return;
     }
     if (checkTerminate(null, null))
     {
         Terminate(senders, myPoints);
     }
 }
 public override void Continue(object[] senders, My_Point[] myPoints)
 {
     if (myPoints != null && senders != null && checkValid(senders, myPoints))
     {
         Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
         gestureEventArgs.GesturePoints = myPoints;
         gestureEventArgs.GestureObjects = senders;
         this.Status = GESTURESTATUS.CONTINUE;
         OnContinued(this, gestureEventArgs);
     }
     if (!checkValid(senders, myPoints))
     {
         Fail();
         return;
     }
     if (checkTerminate(null, null))
     {
         Terminate(senders, myPoints);
     }
 }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Card c = gEventArgs.GestureObjects[0] as Card;
     Menu_Sort_Box b = gEventArgs.GestureObjects[1] as Menu_Sort_Box;
     if (!gestureControler.Control.MainWindow.MenuLayer.IsButtonInOriginPos(b))
     {
         c.SortToGroup(b);
         Group_List.Add(b, c);
         My_Point point = gEventArgs.GesturePoints[0];
         Vector v = new Vector(c.PreviousPostion.X - c.CurrentPosition.X, c.PreviousPostion.Y - c.CurrentPosition.Y);
         v.Normalize();
         c.MoveCard(v.X * 150, v.Y * 150, 0.5);
     }
     if (Group_List.CardGroups.ContainsKey(b))
     {
         Card[] cards = Group_List.CardGroups[b].ToArray();
         foreach (Card cc in cards) { cc.Dehightlight(); }
     }
     base.TerminateGesture(sender,gEventArgs);
 }
 public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     Menu_Sort_Box button = gEventArgs.GestureObjects[0] as Menu_Sort_Box;
     Card[] cards = new Card[gEventArgs.GestureObjects.Length - 1];
     for (int i = 0; i < cards.Length; i++)
     {
         cards[i] = gEventArgs.GestureObjects[i + 1] as Card;
     }
     foreach (Card card in cards)
     {
         if (!gestureControler.Control.MainWindow.Controlers.SortingBoxControler.ContainCard(button, card))
         {
             gestureControler.Control.MainWindow.Controlers.SortingBoxControler.GroupCard(button, card);
         }
         else
         {
             gestureControler.Control.MainWindow.Controlers.SortingBoxControler.RemoveCard(button, card);
         }
     }
     base.TerminateGesture(sender, gEventArgs);
 }
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Menu_Sort_Box button = gEventArgs.GestureObjects[0] as Menu_Sort_Box;

            Card[] cards = new Card[gEventArgs.GestureObjects.Length - 1];
            for (int i = 0; i < cards.Length; i++)
            {
                cards[i] = gEventArgs.GestureObjects[i + 1] as Card;
            }
            foreach (Card card in cards)
            {
                if (!gestureControler.Control.MainWindow.Controlers.SortingBoxControler.ContainCard(button, card))
                {
                    gestureControler.Control.MainWindow.Controlers.SortingBoxControler.GroupCard(button, card);
                }
                else
                {
                    gestureControler.Control.MainWindow.Controlers.SortingBoxControler.RemoveCard(button, card);
                }
            }
            base.TerminateGesture(sender, gEventArgs);
        }
        public override void TerminateGesture(object sender, Gesture_Event_Args gEventArgs)
        {
            Card          c = gEventArgs.GestureObjects[0] as Card;
            Menu_Sort_Box b = gEventArgs.GestureObjects[1] as Menu_Sort_Box;

            if (!gestureControler.Control.MainWindow.MenuLayer.IsButtonInOriginPos(b))
            {
                c.SortToGroup(b);
                Group_List.Add(b, c);
                My_Point point = gEventArgs.GesturePoints[0];
                Vector   v     = new Vector(c.PreviousPostion.X - c.CurrentPosition.X, c.PreviousPostion.Y - c.CurrentPosition.Y);
                v.Normalize();
                c.MoveCard(v.X * 150, v.Y * 150, 0.5);
            }
            if (Group_List.CardGroups.ContainsKey(b))
            {
                Card[] cards = Group_List.CardGroups[b].ToArray();
                foreach (Card cc in cards)
                {
                    cc.Dehightlight();
                }
            }
            base.TerminateGesture(sender, gEventArgs);
        }
 public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     base.FailGesture(sender, gEventArgs);
 }
 public override void ContinueGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     base.ContinueGesture(sender, gEventArgs);
 }
 public override void FailGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     base.FailGesture(sender, gEventArgs);
 }
 public override void RegisterGesture(object sender, Gesture_Event_Args gEventArgs)
 {
     base.RegisterGesture(sender, gEventArgs);
 }