1-
2- using System ;
3- using System . Collections . Generic ;
4- using System . ComponentModel ;
5- using System . Linq ;
6- using System . Runtime . CompilerServices ;
7- using System . ServiceProcess ;
8- using System . Text ;
1+ using System . ServiceProcess ;
92using System . Threading ;
10- using System . Threading . Tasks ;
113
124namespace NoMoreCookiesService
135{
@@ -25,59 +17,3 @@ static void Main()
2517 }
2618 }
2719}
28-
29- /*
30- using System;
31- using System.Threading;
32- using System.ServiceProcess;
33- using System.Windows.Forms;
34-
35- namespace NoMoreCookiesService
36- {
37- internal static class Program
38- {
39- private static NotifyIcon notifyIcon;
40-
41- static void Main()
42- {
43- // NotifyIcon
44- notifyIcon = new NotifyIcon();
45- notifyIcon.Text = "NoMoreCookiesService";
46- notifyIcon.Visible = true;
47-
48- // context NotifyIcon
49- ContextMenuStrip contextMenu = new ContextMenuStrip();
50- ToolStripMenuItem exitMenuItem = new ToolStripMenuItem("Exit");
51- exitMenuItem.Click += ExitMenuItem_Click;
52- contextMenu.Items.Add(exitMenuItem);
53- notifyIcon.ContextMenuStrip = contextMenu;
54-
55- // double click
56- notifyIcon.DoubleClick += NotifyIcon_DoubleClick;
57-
58- // start service
59- ServiceBase[] ServicesToRun;
60- ServicesToRun = new ServiceBase[]
61- {
62- new MainService()
63- };
64- ServiceBase.Run(ServicesToRun);
65-
66- // Infinity time
67- Application.Run();
68- }
69-
70- private static void ExitMenuItem_Click(object sender, EventArgs e)
71- {
72- // Exit
73- notifyIcon.Visible = false;
74- notifyIcon.Dispose();
75- Application.Exit();
76- }
77-
78- private static void NotifyIcon_DoubleClick(object sender, EventArgs e)
79- {
80-
81- }
82- }
83- } */
0 commit comments