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); } }
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)); }
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); }
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); }