コード例 #1
0
        public void run()
        {
            Thread.Sleep(500);
            TrapInfoEventArgs args = new TrapInfoEventArgs();

            args.cause = "Shut Down";
            OnTrapOccurred(args);
        }
コード例 #2
0
        protected virtual void OnTrapOccurred(TrapInfoEventArgs e)
        {
            EventHandler <TrapInfoEventArgs> handler = TrapOccurred;

            handler.RaiseEvent(this, e);
            //if (handler != null)
            //{
            //    handler(this, e);
            //}
        }
コード例 #3
0
 public void c_TrapOccurred(object sender, TrapInfoEventArgs e)
 {
     Console.WriteLine("<Alert>: cauese/{0}, info/ {1}, ip/{2}, time/{3}",
                       e.cause, e.info, e.ip, DateTime.Now.ToString());
 }