What is the += / -= mean in a delegate data structure in c#?
问题 If I have this code: genetic = new Genetic(); genetic.foundNewBestGroupTour += new Genetico.NewBestGroupTourEventHandler(genetico_foundNewBestGroupTour); What does the += do? genetic.foundNewBestGroupTour -= new Genetico.NewBestGroupTourEventHandler(genetico_foundNewBestGroupTour); What does the -= do? 回答1: Read up on events. The += operator in this context calls the event add accessor, while -= calls the remove accessor. This is usually called subscribing and unsubscribing to the event. The