コード例 #1
0
        void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
        {
            if (LockReasons.Contains(e.Reason))
            {
                _lög.Lög(new LögEntry {
                    Locked = true, Timestamp = DateTime.Now, Message = e.Reason.ToString()
                });
            }

            if (UnlockReasons.Contains(e.Reason))
            {
                _lög.Lög(new LögEntry {
                    Locked = false, Timestamp = DateTime.Now, Message = e.Reason.ToString()
                });
            }
        }
コード例 #2
0
        private void OnApplicationExit(object sender, EventArgs e)
        {
            _lög.Lög(new LögEntry {
                Locked = true, Message = "Service stopped", Timestamp = DateTime.Now
            });
            _sniffer.StopSniffing();

            _trayIcon.Visible = false;
        }
コード例 #3
0
        public SnifferAppContext()
        {
            Application.ApplicationExit += OnApplicationExit;
            InitializeComponent();
            _trayIcon.Visible = true;

            _lög = new Lögger();
            _sniffer = new Sniffer(_lög);

            _lög.Lög(new LögEntry { Locked = false, Message = "Service started", Timestamp = DateTime.Now });
            _sniffer.StartSniffing();
        }
コード例 #4
0
        public SnifferAppContext()
        {
            Application.ApplicationExit += OnApplicationExit;
            InitializeComponent();
            _trayIcon.Visible = true;

            _lög     = new Lögger();
            _sniffer = new Sniffer(_lög);

            _lög.Lög(new LögEntry {
                Locked = false, Message = "Service started", Timestamp = DateTime.Now
            });
            _sniffer.StartSniffing();
        }