
- 事件不是委托
初步了解事件

- 事件可以发生,比如发生公司上市事件,发生股票买入事件,通顺说为可以发生的事情
- 事件通知的消息称为事件参数EventArgs,被通知者通过事件参数做出相应的动作,这种根据事件参数所做出的行为称为响应事件/处理事件,处理事件时具体所做的事情叫做Event Handler 事件处理器
- 概述

namespace EventExampleConsole { internal class Program { private static void Main(string[] args) { Timer t = new Timer();//事件拥有者 t.Interval = 1000;// Boy boy = new Boy(); t.Elapsed += boy.Action; //事件和事件订阅(+=事件订阅操作符) t.Start(); Console.ReadLine(); } }
internal class Boy{internal void Action(object sender, ElapsedEventArgs e){Console.WriteLine("Jump");}}
} ```
这些术语是一个意思
一回事

```csharp
using System;
using System.Timers;