Beispiel #1
0
        private void startPath(object sender, EventArgs e)
        {
            var newPath = new HCPath {
                IpStartPos = _lastMouseDown, Color = Color.Black, IpStartDirection = Direction.East, Name = "(new path)"
            };

            _file.Paths.Add(newPath);
            updateList();
            lstPaths.SelectedItem = newPath;
            editPath();
        }
Beispiel #2
0
        private void startPath()
        {
            var newPath = new HCPath {
                IpStartPos       = _selection,
                Color            = Color.Black,
                IpStartDirection = Direction.East,
                Name             = "(new path)"
            };

            _file.Paths.Add(newPath);
            updateList();
            lstPaths.SelectedItem = newPath;
            editPath();
        }
Beispiel #3
0
        private void selectPath(object sender, EventArgs e)
        {
            if (_ignoreOneListChange)
            {
                _ignoreOneListChange = false;
                return;
            }

            _pathSelectionCounter++;
            var thisCounter = _pathSelectionCounter;
            var timer       = new Timer()
            {
                Enabled = true, Interval = 300
            };
            var path = (HCPath)lstPaths.SelectedItem;

            if (path == null)
            {
                return;
            }
            var off       = true;
            var origColor = path.Color;
            var iter      = 7;

            timer.Tick += delegate
            {
                iter--;
                if (_pathSelectionCounter > thisCounter || iter == 0)
                {
                    _blinkingPath = null;
                    timer.Enabled = false;
                    timer.Dispose();
                }
                else
                {
                    _blinkingPath = off ? path : null;
                    off           = !off;
                }
                rerender();
            };
        }