Beispiel #1
0
        public void Remove(MTContainer element)
        {
            int[] vals = (from n in this
                          where n.Value.MTElement == element
                          select n.Key).ToArray();

            foreach (int i in vals)
            {
                this.Remove(i);
            }
        }
Beispiel #2
0
        public void TouchAdded(Touch t)
        {
            MTContainer cont = Elements.HitTest(t.TouchPoint, true);

            if (cont == null)
            {
                return;
            }

            cont.ObjectTouches.Add(t.TouchId, t);
            Touches.Add(t.TouchId, new TouchElement(t, cont));
        }
Beispiel #3
0
        public void TouchRemoved(int touchId)
        {
            // If touch is not related to an object, nothing we need to do here
            if (!Touches.ContainsKey(touchId))
            {
                return;
            }

            MTContainer cont = Touches[touchId].MTElement;

            cont.ObjectTouches.Remove(touchId);
            Touches.Remove(touchId);
        }
Beispiel #4
0
 public TouchElement(Touch t, MTContainer element)
 {
     Touch     = t;
     MTElement = element;
 }
Beispiel #5
0
 /// <summary>
 /// Registers any FrameworkElement with the TouchFramework ready to accept
 /// touch information.
 /// </summary>
 /// <param name="ele">FrameworkElement object to track touches for.</param>
 /// <returns></returns>
 public void RegisterElement(MTContainer cont)
 {
     this.Assigner.Elements.Add(cont);
 }
 public TouchElement(Touch t, MTContainer element)
 {
     Touch = t;
     MTElement = element;
 }
 /// <summary>
 /// Registers any FrameworkElement with the TouchFramework ready to accept
 /// touch information.
 /// </summary>
 /// <param name="ele">FrameworkElement object to track touches for.</param>
 /// <returns></returns>
 public void RegisterElement(MTContainer cont)
 {
     this.Assigner.Elements.Add(cont);
 }