我这样注册和注销事件。是否需要像这样注销?
void DoSomething()
{
using (MyObject ob = new MyObject())
{
ob.Start += Ob_Start;
ob.Completed += Ob_Completed;
}
}
void Ob_Start(object sender, eventArgs e)
{
}
void Ob_Completed(object sender, eventArgs e)
{
((MyObject)sender).Start -= Ob_Start;
((MyObject)sender).Completed -= Ob_Completed;
}