Home > Net >  Whether need to take the initiative to obtain the status of the event source can be used as a incide
Whether need to take the initiative to obtain the status of the event source can be used as a incide

Time:10-16

Recently in FileSystemWatcher to detect file changes, feel very good, feel internal mechanisms should be similar to the listening mode,
Therefore produced such as topic questions, if under such a scenario, you need to call a web interface to obtain a state of the state, the state under normal circumstances is true, if become false will perform a piece of code, I want to know the status of testing can be designed to the event source?

CodePudding user response:

Inside the netcore this request for you specially designed a interface

IChangeToken and ChangeToken

In the traditional code, IPropertyChanged interface also do the same thing

CodePudding user response:

Target object if we do not support the notification mechanism, can oneself polling target state, and then after the access to information to inform (entrust, event processing), such as radar is so of the work,
  •  Tags:  
  • C #
  • Related