Setting an Event to Null

前端 未结 2 673
你的背包
你的背包 2021-02-07 13:07

I have a code like this:

public class SomeClass
{
    int _processProgress;
    public int ProcessProgress 
    { 
        get { return _processProgress; } 
             


        
2条回答
  •  孤独总比滥情好
    2021-02-07 13:25

    Yes, it will unsubscribe everyone from the event. There is a (bit indirect IMHO) reference to this here:

    When all subscribers have unsubscribed from an event, the event instance in the publisher class is set to null.

提交回复
热议问题