<commit_before>﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace RebootTray.App
{
    internal class CustomApplicationContext : ApplicationContext
    {
        private NotifyIcon NotifyIcon { get; set; }

        public CustomApplicationContext()
        {
            var components = new Container();
            NotifyIcon = new NotifyIcon(components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon = new Icon("reboot.ico"),
                Text = "Copies run command to reboot at 4AM to clipboard.",
                Visible = true
            };
            NotifyIcon.MouseUp += notifyIcon_MouseUp;
        }

        private static void notifyIcon_MouseUp(object sender, EventArgs e)
        {
            var now = DateTime.Now;
            var then = GetNext4AM(now);
            var timespan = then - now;
            var seconds = Math.Round(timespan.TotalSeconds);
            Clipboard.SetText($"shutdown /r /t {seconds}");
        }<commit_msg>Add baloon tip icon<commit_after>﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace RebootTray.App
{
    internal class CustomApplicationContext : ApplicationContext
    {
        private NotifyIcon NotifyIcon { get; set; }

        public CustomApplicationContext()
        {
            var components = new Container();
            NotifyIcon = new NotifyIcon(components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon = new Icon("reboot.ico"),
                Text = "Click to copy a command to reboot at 4AM.",
                Visible = true
            };
            NotifyIcon.MouseUp += notifyIcon_MouseUp;
        }

        private void notifyIcon_MouseUp(object sender, EventArgs e)
        {
            var now = DateTime.Now;
            var then = GetNext4AM(now);
            var timespan = then - now;
            var seconds = Math.Round(timespan.TotalSeconds);
            var text = $"shutdown /r /t {seconds}";
            Clipboard.SetText(text);
            NotifyIcon.ShowBalloonTip(1000,
                "Shutdown Command Coppied",
                $"The shutdown command \"{text}\" was coppied to your clipboard. When run, this will reboot your computer at 4:00 AM.", ToolTipIcon.Info);
        }
{'fraction_non_alphanumeric': 0.08350818296265212, 'fraction_numerical': 0.004616030214015947, 'mean_word_length': 1.932349323493235, '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': '1760052', 'n_tokens_mistral': 626, 'n_tokens_neox': 595, 'n_words': 173}