{"id":1279,"date":"2016-10-15T03:00:17","date_gmt":"2016-10-14T23:00:17","guid":{"rendered":"http:\/\/blog.rc21net.ru\/?p=1279"},"modified":"2022-06-13T02:55:52","modified_gmt":"2022-06-12T22:55:52","slug":"csharp-events","status":"publish","type":"post","link":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/","title":{"rendered":"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events)"},"content":{"rendered":"<p><strong>\u0421\u043e\u0431\u044b\u0442\u0438\u0435<\/strong> &#8212; \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 (\u0442.\u0435. \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u0439&#187;), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043b\u0438\u043a \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u0442.\u0434. \u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0442\u0430\u043a\u043e\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435, \u0441\u043c\u043e\u0433\u0443\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0421\u043e\u0431\u044b\u0442\u0438\u044f &#8212; \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p><!--more--><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0438\u043f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c:<\/p>\n<ul>\n<li>\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 &#8212; \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043b\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f;<\/li>\n<li>\u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439;<\/li>\n<li>\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e.<\/li>\n<\/ul>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 C#\u00a0\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430\u0445. \u041f\u043e \u0441\u0443\u0442\u0438, \u0441\u043e\u0431\u044b\u0442\u0438\u0435 &#8212; \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043b\u044e\u0431\u043e\u0433\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u043d\u0435\u0435 \u0442\u0438\u043f\u0430 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432 \u044d\u0442\u043e\u0442 \u0434\u0435\u043b\u0435\u0433\u0430\u0442. \u041e\u0442\u043c\u0435\u043d\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 &#8212; \u043f\u0443\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0437 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430. \u0410 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430.<\/p>\n<p>\u0421\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u0430\u043a \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>\u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <code>event<\/code><\/strong>. \u0421\u043e\u0431\u044b\u0442\u0438\u044e \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430,\u00a0\u0442\u0438\u043f &#8212; \u043b\u044e\u0431\u043e\u0439 \u0440\u0430\u043d\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430, \u0438 \u0438\u043c\u044f &#8212; \u043b\u044e\u0431\u043e\u0439 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. \u041f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0447\u043b\u0435\u043d-\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438:<\/p>\n<pre class=\"lang:c# decode:true\">public delegate void PriceChangedHandler\u00a0(decimal oldPrice, decimal newPrice);\npublic class Stock\n{\n\u00a0 \u00a0 string symbol; decimal price;\n\u00a0 \u00a0 public Stock (string symbol) { this.symbol = symbol; }\n\u00a0 \u00a0 public event PriceChangedHandler PriceChanged;\n\u00a0 \u00a0 public decimal Price\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \u00a0 get { return price; }\n\u00a0 \u00a0 \u00a0 \u00a0 set\n\u00a0 \u00a0 \u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (price == value) return;\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0if (PriceChanged != null)\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0PriceChanged (price, value);\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0price = value;\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 }\n}<\/pre>\n<p>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0447\u043b\u0435\u043d\u0430-\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c <code>public<\/code> \u0432\u044b\u0437\u0432\u0430\u043d \u043a\u0430\u043a \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0442.\u043a. \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0438\u043f \u043c\u043e\u0436\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u0412\u043d\u0435\u0448\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b\u00a0\u043c\u043e\u0433\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u0437 \u0447\u043b\u0435\u043d\u0430-\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u0432\u043e\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <code>+=<\/code> \u0438 <code>-=<\/code>, \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442.<\/p>\n<p>\u0427\u043b\u0435\u043d\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 (virtual), \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 (overridden), \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u043c\u0438 (abstract), \u0437\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u043d\u043d\u044b\u043c\u0438 (sealed), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 (static).<\/p>\n<h2>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/h2>\n<p>.NET Framework \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u041e\u043d \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre class=\"lang:c# decode:true\">public class PriceChangedEventArgs : EventArgs\n{\n\u00a0 \u00a0 public readonly decimal LastPrice, NewPrice;\n\u00a0 \u00a0 public PriceChangedEventArgs (decimal lastPrice,\u00a0decimal newPrice)\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \u00a0 LastPrice = lastPrice; NewPrice = newPrice;\n\u00a0 \u00a0 }\n}\npublic class Stock\n{\n\u00a0 \u00a0\u00a0string symbol; decimal price;\n\u00a0 \u00a0\u00a0public Stock (string symbol) { this.symbol = symbol; }\n\u00a0 \u00a0\u00a0public event EventHandler&lt;PriceChangedEventArgs&gt;\u00a0PriceChanged;\n\u00a0 \u00a0\u00a0protected virtual void OnPriceChanged\u00a0(PriceChangedEventArgs e)\n\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0if (PriceChanged != null) PriceChanged (this, e);\n\u00a0 \u00a0\u00a0}\n\u00a0 \u00a0\u00a0public decimal Price\n\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0get { return price; }\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0set\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0if (price == value) return;\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0OnPriceChanged (new PriceChangedEventArgs (price,\u00a0value));\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0price = value;\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0}\n\u00a0 \u00a0\u00a0}\n}<\/pre>\n<h3>\u0422\u0438\u043f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438<\/h3>\n<p>\u041f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e, \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c\u00a0\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438\u00a0\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c-\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. \u042d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441. \u041f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u00a0\u0442\u0438\u043f\u0430 <code>System.EventArgs<\/code>, \u0430 \u0438\u043c\u044f \u0435\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u043e\u043c\u00a0<code>EventArgs<\/code>.<\/p>\n<pre class=\"lang:c# decode:true\">public class PriceChangedEventArgs : EventArgs\n{\n\u00a0 \u00a0 public readonly decimal LastPrice, NewPrice;\n\u00a0 \u00a0\u00a0public PriceChangedEventArgs (decimal lastPrice,\u00a0decimal newPrice)\n\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0LastPrice = lastPrice; NewPrice = newPrice;\n\u00a0 \u00a0\u00a0}\n}<\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441\u00a0<code>System.EventArgs<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0447\u043b\u0435\u043d (\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043b\u0435 <code>Empty<\/code>)\u00a0\u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre class=\"lang:c# decode:true\">public class EventArgs\n{\n\u00a0 \u00a0 public static readonly EventArgs Empty = new EventArgs();\n\u00a0 \u00a0 public EventArgs () {}\n}<\/pre>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0442.\u043a. \u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438. \u041d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0430\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>EventArgs<\/code>, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u043e\u043b\u0435\u043c\u00a0<code>Empty<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h3>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u043b\u0435\u043d\u0430-\u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u0442\u043c\u0435\u0447\u0430\u043b\u043e\u0441\u044c, \u043d\u0443\u0436\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u043b\u0435\u043d-\u0441\u043e\u0431\u044b\u0442\u0438\u0435.<\/p>\n<pre class=\"lang:c# decode:true\">public event EventHandler&lt;PriceChangedEventArgs&gt;\u00a0PriceChanged;<\/pre>\n<p>\u0422\u0438\u043f\u043e\u043c \u0434\u043b\u044f \u0447\u043b\u0435\u043d\u0430-\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u00a0.NET Framework <strong>\u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u00a0<code>System.EventHandler&lt;TEventArgs&gt;<\/code><\/strong>:<\/p>\n<pre class=\"lang:c# decode:true\">public delegate void EventHandler&lt;TEventArgs&gt;\n\u00a0 \u00a0 (object sender, TEventArgs e)\n\u00a0 \u00a0 \u00a0 \u00a0 where TEventArgs : EventArgs;<\/pre>\n<p>\u0414\u0435\u043b\u0435\u0433\u0430\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.\u00a0\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <strong>\u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>source<\/code><\/strong> \u0432 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0442.\u0435. \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430 \u0432 \u043d\u0435\u0433\u043e <strong>\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f <code>this<\/code><\/strong>.\u00a0\u0412 \u0446\u0435\u043b\u044f\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0442\u0438\u043f\u043e\u043c <code>object<\/code>, \u0430 \u043d\u0435 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<p><strong>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8212; \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438<\/strong> (\u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435). \u0415\u043c\u0443 \u0443\u0436\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0442\u0438\u043f\u0430 \u0432 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 (<code>TEventArgs<\/code>). \u041f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e \u0432 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0435 \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>e<\/code>.<\/p>\n<p>\u0414\u0435\u043b\u0435\u0433\u0430\u0442\u00a0<code>EventHandler<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>void<\/code>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u0442\u043e\u0434\u044b-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>void<\/code>.<\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434,\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0447\u043b\u0435\u043d-\u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/h3>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0438\u0437 \u043a\u043e\u0434\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041f\u043e \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043c\u0430\u0441\u043a\u0435 <code><strong>On<\/strong>-<em>\u0438\u043c\u044f-\u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/em><\/code>. \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0447\u043b\u0435\u043d\u0430-\u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043b\u0438 \u0432 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0435 \u0447\u043b\u0435\u043d\u0435-\u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u044b-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0438 \u0435\u0441\u043b\u0438 \u0434\u0430, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u043b\u0435\u043d-\u0441\u043e\u0431\u044b\u0442\u0438\u0435.<\/p>\n<pre class=\"lang:c# decode:true\">protected virtual void OnPriceChanged\u00a0(PriceChangedEventArgs e)\n{\n\u00a0 \u00a0 if (PriceChanged != null) PriceChanged (this, e);\n}<\/pre>\n<h3>\u041c\u0435\u0442\u043e\u0434, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/h3>\n<p>\u0423 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0432 \u043e\u0442\u0432\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u0412\u043c\u0435\u0441\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<pre class=\"lang:c# decode:true\">public decimal Price\n{\n\u00a0 \u00a0 get { return price; }\n\u00a0 \u00a0 set\n\u00a0 \u00a0 {\n\u00a0 \u00a0 \u00a0 \u00a0 if (price == value) return;\n\u00a0 \u00a0 \u00a0 \u00a0 OnPriceChanged (new PriceChangedEventArgs (price,\u00a0value));\n\u00a0 \u00a0 \u00a0 \u00a0 price = value;\n\u00a0 \u00a0 }\n}<\/pre>\n<h3>\u0422\u0438\u043f, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u0442\u0438\u043f\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u00a0\u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u00a0<code>PriceChanged<\/code> \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u00a0<code>Stock<\/code>:<\/p>\n<pre class=\"lang:c# decode:true\">class Someclass\n{\n\u00a0 \u00a0 static void Main()\n\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0Stock stock = new Stock (\"THPW\");\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0stock.Price = 27.10M;\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0stock.PriceChanged += stock_PriceChanged; \/\/\u00a0\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0stock.Price = 31.59M;\n\u00a0 \u00a0\u00a0}\n\u00a0 \u00a0 \/\/ \u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\n\u00a0 \u00a0\u00a0static void stock_PriceChanged\u00a0(object sender, PriceChangedEventArgs e)\n\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0if ((e.NewPrice - e.LastPrice) \/ e.LastPrice &gt; 0.1M)\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0Console.WriteLine (\"Alert, 10% price increase!\");\n\u00a0 \u00a0\u00a0}\n}<\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0443\u00a0<code>EventHandler<\/code> &#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>void\u00a0<\/code>\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: <code>sender<\/code> \u0438 <code>e<\/code>.<\/p>\n<p><code>Sender<\/code> \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0435\u0433\u043e\u00a0\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u00a0\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c (\u0442.\u0435. \u0442\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 &#8212; \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430 <code>Stock<\/code>) \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0435\u043c\u0443 \u043a\u0430\u043a\u0443\u044e \u043b\u0438\u0431\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u044f, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>e<\/code> &#8212; \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 (\u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e\u00a0<code>Stock<\/code>).<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u0435\u0442\u043e\u0434\u00a0\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0447\u043b\u0435\u043d-\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 Stock:<\/p>\n<pre class=\"lang:c# decode:true\">stock.PriceChanged += stock_PriceChanged;<\/pre>\n<h2>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438<\/h2>\n<p>\u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0443\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<pre class=\"lang:c# decode:true\">public class Stock\n{\n\u00a0 \u00a0 string symbol; decimal price;\n\u00a0 \u00a0\u00a0public Stock (string symbol) {this.symbol = symbol;}\n\u00a0 \u00a0\u00a0public event EventHandler PriceChanged;\n\u00a0 \u00a0\u00a0protected virtual void OnPriceChanged (EventArgs e)\n\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0if (PriceChanged != null) PriceChanged (this, e);\n\u00a0 \u00a0\u00a0}\n\u00a0 \u00a0\u00a0public decimal Price\n\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0get { return price; }\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0set\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0{\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0if (price == value) return;\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0price = value;\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0OnPriceChanged (EventArgs.Empty);\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0}\n\u00a0 \u00a0\u00a0}\n}<\/pre>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0435\u0442 \u043d\u0443\u0436\u0434\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0442\u0438\u043f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u00a0<code>EventArgs<\/code> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 .NET Framework.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u00a0<code>EventArgs<\/code>.<\/p>\n<p>\u0418 \u0432-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430\u00a0<code>EventArgs<\/code>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c\u00a0<code>Empty<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435\u00a0\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441.<\/p>\n<h2>\u0421\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (Event Accessors)<\/h2>\n<p>\u0421\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0432 <code>+=<\/code> \u0438 <code>-=<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0422.\u0435. \u0442\u0430\u043a\u043e\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f:<\/p>\n<pre class=\"lang:c# decode:true\">public event EventHandler PriceChanged;<\/pre>\n<p>\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435-\u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u0438 \u043f\u0430\u0440\u0443 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b += \u0438 -= \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0447\u0430\u0441\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e-\u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0443.<\/p>\n<pre class=\"lang:c# decode:true  \">EventHandler _priceChanged; \/\/\u00a0\u0427\u0430\u0441\u0442\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\npublic event EventHandler PriceChanged\n{\n\u00a0 \u00a0 add { _priceChanged += value; }\n\u00a0 \u00a0 remove { _priceChanged -= value; }\n}<\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0432 \u043f\u043e\u043b\u0435-\u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0435\u043c\u0443 \u0438\u0437 \u0447\u043b\u0435\u043d\u0430-\u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432 \u0434\u0435\u043b\u0435\u0433\u0430\u0442.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>\u0421\u043e\u0431\u044b\u0442\u0438\u0435 &#8212; \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 (\u0442.\u0435. \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 &#171;\u0441\u043e\u0431\u044b\u0442\u0438\u0439&#187;), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043b\u0438\u043a \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u0442.\u0434. \u0414\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0442\u0430\u043a\u043e\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435, \u0441\u043c\u043e\u0433\u0443\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0421\u043e\u0431\u044b\u0442\u0438\u044f &#8212; \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[29],"tags":[11],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.4.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events) | devKazakov.com<\/title>\n<meta name=\"description\" content=\"\u0421\u043e\u0431\u044b\u0442\u0438\u0435 - \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events) | devKazakov.com\" \/>\n<meta property=\"og:description\" content=\"\u0421\u043e\u0431\u044b\u0442\u0438\u0435 - \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/\" \/>\n<meta property=\"og:site_name\" content=\"devKazakov.com\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-14T23:00:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-12T22:55:52+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roman Kazakov\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u043c\u0438\u043d\u0443\u0442\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/devkazakov.com\/ru\/#website\",\"url\":\"https:\/\/devkazakov.com\/ru\/\",\"name\":\"devKazakov.com\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/devkazakov.com\/ru\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#webpage\",\"url\":\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/\",\"name\":\"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events) | devKazakov.com\",\"isPartOf\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#website\"},\"datePublished\":\"2016-10-14T23:00:17+00:00\",\"dateModified\":\"2022-06-12T22:55:52+00:00\",\"description\":\"\u0421\u043e\u0431\u044b\u0442\u0438\u0435 - \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.\",\"breadcrumb\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/devkazakov.com\/ru\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events)\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#webpage\"},\"author\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\"},\"headline\":\"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events)\",\"datePublished\":\"2016-10-14T23:00:17+00:00\",\"dateModified\":\"2022-06-12T22:55:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#webpage\"},\"wordCount\":55,\"publisher\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\"},\"keywords\":[\"C#\"],\"articleSection\":[\"C#\"],\"inLanguage\":\"ru-RU\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\",\"name\":\"Roman Kazakov\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/devkazakov.com\/ru\/#personlogo\",\"inLanguage\":\"ru-RU\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g\",\"caption\":\"Roman Kazakov\"},\"logo\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#personlogo\"},\"sameAs\":[\"https:\/\/devkazakov.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events) | devKazakov.com","description":"\u0421\u043e\u0431\u044b\u0442\u0438\u0435 - \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/","og_locale":"ru_RU","og_type":"article","og_title":"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events) | devKazakov.com","og_description":"\u0421\u043e\u0431\u044b\u0442\u0438\u0435 - \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.","og_url":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/","og_site_name":"devKazakov.com","article_published_time":"2016-10-14T23:00:17+00:00","article_modified_time":"2022-06-12T22:55:52+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"Roman Kazakov","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"7 \u043c\u0438\u043d\u0443\u0442"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/devkazakov.com\/ru\/#website","url":"https:\/\/devkazakov.com\/ru\/","name":"devKazakov.com","description":"","publisher":{"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devkazakov.com\/ru\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ru-RU"},{"@type":"WebPage","@id":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#webpage","url":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/","name":"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events) | devKazakov.com","isPartOf":{"@id":"https:\/\/devkazakov.com\/ru\/#website"},"datePublished":"2016-10-14T23:00:17+00:00","dateModified":"2022-06-12T22:55:52+00:00","description":"\u0421\u043e\u0431\u044b\u0442\u0438\u0435 - \u044d\u0442\u043e \u0447\u043b\u0435\u043d \u0442\u0438\u043f\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e\u00a0\u044d\u0442\u043e\u0442 \u0442\u0438\u043f (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043e\u0441\u043e\u0431\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445.","breadcrumb":{"@id":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devkazakov.com\/ru\/"},{"@type":"ListItem","position":2,"name":"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events)"}]},{"@type":"Article","@id":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#article","isPartOf":{"@id":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#webpage"},"author":{"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3"},"headline":"C#: \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Events)","datePublished":"2016-10-14T23:00:17+00:00","dateModified":"2022-06-12T22:55:52+00:00","mainEntityOfPage":{"@id":"https:\/\/devkazakov.com\/ru\/blog\/csharp-events\/#webpage"},"wordCount":55,"publisher":{"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3"},"keywords":["C#"],"articleSection":["C#"],"inLanguage":"ru-RU"},{"@type":["Person","Organization"],"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3","name":"Roman Kazakov","image":{"@type":"ImageObject","@id":"https:\/\/devkazakov.com\/ru\/#personlogo","inLanguage":"ru-RU","url":"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g","caption":"Roman Kazakov"},"logo":{"@id":"https:\/\/devkazakov.com\/ru\/#personlogo"},"sameAs":["https:\/\/devkazakov.com"]}]}},"_links":{"self":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts\/1279"}],"collection":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/comments?post=1279"}],"version-history":[{"count":1,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts\/1279\/revisions"}],"predecessor-version":[{"id":2131,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts\/1279\/revisions\/2131"}],"wp:attachment":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/media?parent=1279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/categories?post=1279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/tags?post=1279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}