Пример #1
0
        private void DrawCaret()
        {
            blinkTimer.Stop();
            checkTimer?.Dispose();

            var caret = new VisualElement();

            caret.Draw(CaretPosition);
            visuals.Clear();
            visuals.Add(caret);

            isCaretVisible = true;
        }
Пример #2
0
        private void InitBlinker()
        {
            blinkTimer       = new DispatcherTimer();
            blinkTimer.Tick += (sender, e) => {
                Application.Current.Dispatcher.Invoke((Action)(() => {
                    if (isCaretVisible)
                    {
                        var caret = new VisualElement();

                        caret.Draw(CaretPosition);
                        visuals.Add(caret);
                    }
                    else
                    {
                        visuals.Clear();
                    }

                    isCaretVisible = !isCaretVisible;
                }));
            };
            blinkTimer.Interval = new TimeSpan(0, 0, 0, 0, BLINK_INTERVAL);
        }
Пример #3
0
        private void DrawCaret() {
            blinkTimer.Stop();
            checkTimer?.Dispose();

            var caret = new VisualElement();

            caret.Draw(CaretPosition);
            visuals.Clear();
            visuals.Add(caret);

            isCaretVisible = true;
        }
Пример #4
0
        private void InitBlinker() {
            blinkTimer = new DispatcherTimer();
            blinkTimer.Tick += (sender, e) => {
                Application.Current.Dispatcher.Invoke((Action)(() => {
                    if (isCaretVisible) {
                        var caret = new VisualElement();

                        caret.Draw(CaretPosition);
                        visuals.Add(caret);
                    } else {
                        visuals.Clear();
                    }

                    isCaretVisible = !isCaretVisible;
                }));
            };
            blinkTimer.Interval = new TimeSpan(0, 0, 0, 0, BLINK_INTERVAL);
        }