Example #1
0
        public void endTouches(NSSet touches, UIEvent evt)
        {
            if (linesInProcess.Count < 1)
            {
                bool   firstTouch = true;
                Circle circle     = null;
                string key        = "";
                // Remove ending touches from Dictionary
                foreach (UITouch t in touches)
                {
                    if (firstTouch)
                    {
                        key = NSValue.ValueFromNonretainedObject(t).ToString();
                        // Find the circle for this touch
                        circlesInProcess.TryGetValue(key, out circle);
                        firstTouch = false;
                    }
                }
                // If this is a double tap, "line" will be nil
                // so make sure not to add it to the array
                if (circle != null)
                {
                    LineStore.addCompletedCircle(circle);
                    circlesInProcess.Remove(key);
                }
            }
            else
            {
                // Remove ending touches from Dictionary
                foreach (UITouch t in touches)
                {
                    string key = NSValue.ValueFromNonretainedObject(t).ToString();

                    // Find the line for this touch
                    Line line = new Line();
                    linesInProcess.TryGetValue(key, out line);

                    // If this is a double tap, "line" will be nil
                    // so make sure not to add it to the array
                    if (line != null)
                    {
                        LineStore.addCompletedLine(line);
                        linesInProcess.Remove(key);
                    }
                }
            }
            this.SetNeedsDisplay();
        }
Example #2
0
        public void endTouches(NSSet touches)
        {
            // Remove ending touches from Dictionary
            foreach (UITouch t in touches)
            {
                string key = NSValue.ValueFromNonretainedObject(t).ToString();

                // Find the line for this touch
                Line line = new Line();
                linesInProcess.TryGetValue(key, out line);

                // If this is a double tap, "line" will be nil
                // so make sure not to add it to the array
                if (line != null)
                {
                    LineStore.addCompletedLine(line);
                    linesInProcess.Remove(key);
                }
            }
            this.SetNeedsDisplay();
        }