I have a question about events in C #. Suppose I have an object obj1 of a class that provides an event, and this object runs on thread t1. Now in another thread t2 there is another object named obj2 registered for the event obj1.
Is obj2 expected to receive an event when it is raised? thank.
Yes. However, the event will be raised (which means that the event handler will be fired) in the method thread that raises it. In your case, it will be raised to t1.
"obj2" , t2, . , , , "obj2" .
Source: https://habr.com/ru/post/1739542/More articles:How can I make an ASP.NET MVC site as a unit that can be tested as an ASP.NET Web Forms site? - asp.netMembership in asp.net: expanding membership in roles? - asp.netΠΠ΅Π»ΡΡΠΈΠΉ 2009 MS Build headaches - delphiWriting a Javascript library that is suitable for code completion and code verification - javascriptStarting a new project - where to start? - unit-testingIronPython overrides __setattr__ and __getattr__ - c #using Spring JdbcTemplate for multiple database operations - javaKeep-alive for long-term HTTP session (non-persistent HTTP) - httpWhy does the checkbox attribute "checked" return the actual value opposite to it on a click event? - javascriptiPhone: Monthly Grouping - Basic Data - iphoneAll Articles