Esempio n. 1
0
        private void On(object sender, EventArgs e)
        {
            MenuItem it = sender as MenuItem;

            it.Checked = !it.Checked;
            KeyListenercs.OnOff(it.Checked);
        }
Esempio n. 2
0
        public Tray()
        {
            trayMenu = new ContextMenu();
            TeeMenu();

            KeyListenercs.Start();

            DataBase.Connect();

            trayIcon      = new NotifyIcon();
            trayIcon.Text = "Avain";
            if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Avain\\Key.ico"))
            {
                trayIcon.Icon = new Icon(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Avain\\Key.ico");
            }
            else
            {
                trayIcon.Icon = new Icon("Resources\\Key.ico");
            }
            KeyListenercs.NI = trayIcon;

            trayIcon.ContextMenu = trayMenu;
            trayIcon.Visible     = true;
        }
Esempio n. 3
0
 private void OnExit(object sender, EventArgs e)
 {
     AccessSQL.AccessHandler.SuljeYhteys();
     KeyListenercs.Unsubscribe();
     Application.Exit();
 }