<commit_before>﻿using System;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Pomo
{
    public partial class CountdownForm : Form
    {
        #region Private Members

        Pomodoro _pomodoro;
        int _hideCountdown = 0;
        Timer _hideTimer;
        Timer _updateTimer;
        bool _isFading = false;

        #endregion

        #region Constructors

        public CountdownForm()
        {
            InitializeComponent();

            Left = Screen.PrimaryScreen.WorkingArea.Width - Width - 10;
            Top = Screen.PrimaryScreen.WorkingArea.Height - Height - 10;
        }

        public CountdownForm(Pomodoro pomodoro)
            : this()
        {
            _pomodoro = pomodoro;

            _updateTimer = new Timer
            {
                Interval = 250,
                Enabled = true
            };

            _updateTimer.Tick += Pomodoro_Tick;

            _hideTimer = new Timer
            {
                Interval = 1000,
                Enabled = true
            };

            _hideTimer.Tick += _hideTimer_Tick;

            Visible = false;
        }

        #endregion

        #region Public Methods

        public void DoShow()
        {
            _hideCountdown = 3;

            Left = Screen.PrimaryScreen.WorkingArea.Width - Width - 10;
            Top = Screen.PrimaryScreen.WorkingArea.Height - Height - 10;

            if (Visible) { return; }

            Opacity = 0;
            Visible = true;

            FadeIn();
        }

        #endregion

        #region Private Methods

        void _hideTimer_Tick(object sender, EventArgs e)
        {
            if (_hideCountdown == 0)
            {
                FadeOut();
            }
            else
            {
                _hideCountdown--;
            }
        }<commit_msg>ensure window is topmost<commit_after>﻿using System;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Pomo
{
    public partial class CountdownForm : Form
    {
        #region Private Members

        Pomodoro _pomodoro;
        int _hideCountdown = 0;
        Timer _hideTimer;
        Timer _updateTimer;
        bool _isFading = false;

        #endregion

        #region Constructors

        public CountdownForm()
        {
            InitializeComponent();

            Left = Screen.PrimaryScreen.WorkingArea.Width - Width - 10;
            Top = Screen.PrimaryScreen.WorkingArea.Height - Height - 10;
        }

        public CountdownForm(Pomodoro pomodoro)
            : this()
        {
            _pomodoro = pomodoro;

            _updateTimer = new Timer
            {
                Interval = 250,
                Enabled = true
            };

            _updateTimer.Tick += Pomodoro_Tick;

            _hideTimer = new Timer
            {
                Interval = 1000,
                Enabled = true
            };

            _hideTimer.Tick += _hideTimer_Tick;

            Visible = false;
        }

        #endregion

        #region Public Methods

        public void DoShow()
        {
            _hideCountdown = 3;

            Left = Screen.PrimaryScreen.WorkingArea.Width - Width - 10;
            Top = Screen.PrimaryScreen.WorkingArea.Height - Height - 10;

            if (Visible) { return; }

            Opacity = 0;
            Visible = true;
            TopMost = true;

            FadeIn();
        }

        #endregion

        #region Private Methods

        void _hideTimer_Tick(object sender, EventArgs e)
        {
            if (_hideCountdown == 0)
            {
                FadeOut();
            }
            else
            {
                _hideCountdown--;
            }
        }
{'fraction_non_alphanumeric': 0.07232119117256049, 'fraction_numerical': 0.010103695825578303, 'mean_word_length': 1.2406194163192377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5070992', 'n_tokens_mistral': 1060, 'n_tokens_neox': 930, 'n_words': 225}