{"id":201396,"date":"2013-11-08T17:28:03","date_gmt":"2013-11-08T13:28:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=201396"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=201396","title":{"rendered":"<span class=\"post_title\">\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u0442\u044c<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0434\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0438\u0437 \u043c\u0438\u0440\u0430 .NET. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e:  <\/p>\n<ul>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.internalsvisibletoattribute(v=vs.110).aspx\">InternalsVisibleToAttribute<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.typeforwardedtoattribute(v=vs.110).aspx\">TypeForwardedToAttribute<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.callermembernameattribute(v=vs.110).aspx\">CallerMemberNameAttribute<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.methodimplattribute(v=vs.110).aspx\">MethodImplAttribute<\/a><\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>InternalsVisibleToAttribute<\/h5>\n<p>  <i>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d?<\/i> \u042d\u0442\u043e\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u0435\u0440\u0435 \u0434\u0430\u043b\u044c\u043d\u0438\u043c \u0440\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u0438\u043a\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443 friend \u0438\u0437 C++. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a internal \u0442\u0438\u043f\u0430\u043c \u0438 internal \u0447\u043b\u0435\u043d\u0430\u043c \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438. \u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0440\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u043e\u043d \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0435\u0449\u0451 \u0432 .NET 2.0.<\/p>\n<p>  <i>\u041a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f?<\/i> \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043b\u044f internal \u0442\u0438\u043f\u043e\u0432.(\u0412\u044b \u0432\u0435\u0434\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043a internal sealed, \u043f\u0440\u0430\u0432\u0434\u0430?)<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440:<\/i> \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0430 Domain.dll, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 internal \u0442\u0438\u043f DefaultTimeScalingStrategy. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0430 \u0441 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 Domain.Tests.dll. \u041f\u0443\u0441\u0442\u044c \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0442\u0438\u043f\u0430 DefaultTimeScalingStrategy. \u0422\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 Domain.dll \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c:<\/p>\n<pre><code class=\"cs\">[assembly: InternalsVisibleTo(&quot;Domain.Tests&quot;)] <\/code><\/pre>\n<p>  <i>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/i> \u0415\u0441\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0430 Domain.Tests.dll \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0435 \u0438\u043c\u044f, \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438, \u043d\u043e \u0438 \u0435\u0451 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447(\u041d\u0415 \u0442\u043e\u043a\u0435\u043d).<\/p>\n<h5>TypeForwardedToAttribute<\/h5>\n<p>  <i>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d?<\/i> \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0438\u043f \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e, \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u0442\u0438\u043f\u0430 <s>\u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f<\/s> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0413\u043e\u0432\u043e\u0440\u044f \u0432 \u043e\u0431\u0449\u0435\u043c, \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u043e\u0432 \u0432 CLR, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms404275(v=vs.110).aspx\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<p>  <i>\u041a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f?<\/i> \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u0441\u0431\u043e\u0440\u043a\u0443 (Crypto.dll v1.0.0.0), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0440\u043e\u0441\u043e\u043c. \u041f\u043e\u043b\u0430\u0433\u0430\u044e, \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u0441\u0432\u043e\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0435 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0442\u0438\u043f(BlumBlumShub) \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443(PRNG.dll). <br \/>  \u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438:  <\/p>\n<ol>\n<li>\u041f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0431\u043e\u0440\u043a\u0438(Crypto.dll v1.1.0.0), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443(PRNG.dll). \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f(BlumBlumShub), \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d \u0438 CLR \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442, \u0433\u0434\u0435 \u0435\u0433\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043a\u0430\u0442\u044c.<\/li>\n<li>\u0412\u044b\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0431\u043e\u0440\u043a\u0438(Crypto.dll v1.1.0.0), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443(PRNG.dll), \u0438 \u0434\u0430\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 CLR \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>TypeForwardedToAttribute<\/i> \u043e \u043d\u043e\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u0442\u0438\u043f\u0430.<\/li>\n<\/ol>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440:<\/i> \u041f\u0443\u0441\u0442\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0430(Crypto.dll), \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0442\u0438\u043f(BlumBlumShub) \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443(PRNG.dll). \u0422\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 Crypto \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">[assembly: TypeForwardedTo(typeof(BlumBlumShub))] <\/code><\/pre>\n<p>  \u0438, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0442\u0438\u043f.<\/p>\n<p>  <i>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f:<\/i>  <\/p>\n<ol>\n<li>\u0423 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u0435\u0440\u043e\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043d\u0442\u0430\u0433\u043e\u043d\u0438\u0441\u0442 \u2014 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.typeforwardedfromattribute(v=vs.110).aspx\">TypeForwardedFromAttribute<\/a>.<\/li>\n<li>\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u0431\u0436\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c .NET 4.0: \u0442\u0438\u043f <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb549311(v=vs.100).aspx\">Action&lt;,&gt;<\/a> \u043f\u0430\u043b \u0435\u0433\u043e \u0436\u0435\u0440\u0442\u0432\u043e\u0439<\/li>\n<li>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e <i>TypeForwardedFromAttribute<\/i> \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c(custom attribute), \u044d\u0442\u043e \u2014 \u043f\u0441\u0435\u0432\u0434\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442(pseudo custom attribute). \u0411\u043e\u043b\u044c\u0448\u0435 \u043e \u043f\u0441\u0435\u0432\u0434\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/www.simple-talk.com\/blogs\/2010\/11\/30\/subterranean-il-pseudo-custom-attributes\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/li>\n<li>\u0411\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0430\u0431\u0436\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/sergeyteplyakov.blogspot.com\/2013\/10\/net.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/li>\n<\/ol>\n<h5>CallerMemberNameAttribute<\/h5>\n<p>  <i>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d?<\/i> \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u0432\u0430\u043b \u0432\u0430\u0448 \u043a\u043e\u0434.<\/p>\n<p>  <i>\u041a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f?<\/i> \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445:  <\/p>\n<ol>\n<li>\u0422\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u043a\u043e\u0434\u0430<\/li>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 INotifyPropertyChanged<\/li>\n<\/ol>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440:<\/i> \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0435\u0445\u0438\u0442\u0440\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u043e\u0442 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <i>INotifyPropertyChanged<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u0440\u044f\u0434\u043d\u043e \u043f\u043e\u0440\u0442\u044f\u0442 \u043a\u0440\u043e\u0432\u044c \u043f\u0440\u0438 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0435.<br \/>  \u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0440\u0430\u043d\u044c\u0448\u0435:<\/p>\n<pre><code class=\"cs\">   internal sealed class Star : INotifyPropertyChanged     {         private int _luminosity;          public int Luminosity         {             get { return _luminosity; }              set             {                 if (value != _luminosity)                 {                     _luminosity = value;                     OnPropertyChanged(&quot;Luminosity&quot;);                 }             }         }          private void OnPropertyChanged(string propertyName)         {             var handler = PropertyChanged;             if (handler != null)             {                 handler(this, new PropertyChangedEventArgs(propertyName));             }         } } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0441\u0442\u0430\u043b\u043e \u0441\u0435\u0439\u0447\u0430\u0441:<\/p>\n<pre><code class=\"cs\">internal sealed class Star : INotifyPropertyChanged     {         private int _luminosity;          public int Luminosity         {             get { return _luminosity; }              set             {                 if (value != _luminosity)                 {                     _luminosity = value;                     OnPropertyChanged();                 }             }         }          private void OnPropertyChanged([CallerMemberName]string propertyName = null)         {             var handler = PropertyChanged;             if (handler != null)             {                 handler(this, new PropertyChangedEventArgs(propertyName));             }         }          public event PropertyChangedEventHandler PropertyChanged;     }  <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <i>OnPropertyChanged<\/i>.<\/p>\n<p>  <i>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f: <\/i>  <\/p>\n<ol>\n<li>\u0423 \u0441\u0430\u0431\u0436\u0430 \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u043c\u0438\u043d\u0443\u0441: \u043e\u043d \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 .NET 4.5. \u0415\u0433\u043e \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 .NET 4.0(\u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0442\u0447\u0430), \u043d\u043e \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0432 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445.<\/li>\n<li>\u0423 \u044d\u0442\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0431\u0440\u0430\u0442\u0430: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.callerfilepathattribute(v=vs.110).aspx\">CallerFilePathAttribute<\/a> \u0438 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.callerlinenumberattribute(v=vs.110).aspx\">CallerLineNumberAttribute<\/a>. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0438\u0445 \u0438\u043c\u0435\u043d\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0441\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u0431\u044f.<\/li>\n<\/ol>\n<h5>MethodImplAttribute<\/h5>\n<p>  <i>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d?<\/i> \u042d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u041c\u043e\u0436\u0435\u0442 \u043e\u043d \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e: \u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d, \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u0412\u0441\u0435\u043c \u044d\u0442\u0438\u043c \u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u0444\u043b\u0430\u0433\u0438 \u0438\u0437 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.methodimploptions(v=vs.110).aspx\">MethodImplOptions<\/a>:  <\/p>\n<ul>\n<li>AggressiveInlining <\/li>\n<li>ForwardRef <\/li>\n<li>InternalCall <\/li>\n<li>NoInlining <\/li>\n<li>NoOptimization <\/li>\n<li>PreserveSig <\/li>\n<li>Synchronized <\/li>\n<li>Unmanaged <\/li>\n<\/ul>\n<p>  <i>\u041a\u043e\u0433\u0434\u0430 \u0435\u0433\u043e \u041d\u0415\u041b\u042c\u0417\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/i> \u041f\u0440\u0438\u0437\u043d\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0441\u0442\u043d\u043e, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0444\u043b\u0430\u0433 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <i>Synchronized<\/i>. \u041d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0432\u0430\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0435\u0440\u0435\u0447\u044c \u043e\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0423\u043c\u043d\u044b\u0439 \u0434\u044f\u0434\u044c\u043a\u0430 \u0414\u0436. \u0420\u0438\u0445\u0442\u0435\u0440 \u043e\u043f\u0438\u0441\u0430\u043b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 <a href=\"http:\/\/www.amazon.com\/CLR-via-C-Developer-Reference\/dp\/0735667454\">\u043a\u043d\u0438\u0433\u0435 <\/a>\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0444\u043b\u0430\u0433\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0432\u0437\u0430\u0438\u043c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0432.<br \/>  \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e \u0434\u043b\u044f \u0444\u043b\u0430\u0433\u0430 <i>Synchronized <\/i> \u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cs\">public void Foo()  {      \/\/ Do something } <\/code><\/pre>\n<p>  \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 c\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"cs\">public void Foo()  {      lock(this)      {           \/\/ Do something      } }  <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0447\u0440\u0435\u0432\u0430\u0442\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 <i>this<\/i>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u044d\u043a\u0441\u0446\u0435\u0441\u0441\u043e\u0432, \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0439\u0442\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <i>Synchronized<\/i>, \u0438 \u0432\u0441\u0451 \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0440:<\/i><\/p>\n<pre><code class=\"cs\"> public static class MathUtility     {         [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]         public static int GetFibonacciNumber(int n)         {             return (int)((Math.Pow((1 + Math.Sqrt(5))\/2, n) - Math.Pow((1 - Math.Sqrt(5))\/2, n))\/Math.Sqrt(5));         }     } <\/code><\/pre>\n<p>  <i>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/i> \u0410\u0442\u0440\u0438\u0431\u0443\u0442 <i>MethodImplAttribute<\/i> \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 <i>TypeForwardedToAttribute<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0441\u0435\u0432\u0434\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u044b\u043b \u043b\u0438 \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u0438\u043b\u0438 \u043d\u0435\u0442, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 API, a \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0435\u0442\u043e\u0434 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.reflection.methodbase.getmethodimplementationflags.aspx\">GetMethodImplementationFlags<\/a> \u043a\u043b\u0430\u0441\u0441\u0430 <i>MethodInfo<\/i>.<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<br \/>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u043f\u043e \u043c\u0435\u0440\u0435 \u0441\u0432\u043e\u0438\u0445 \u0441\u0438\u043b \u0438 \u0437\u043d\u0430\u043d\u0438\u0439. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/201396\/\"> http:\/\/habrahabr.ru\/post\/201396\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0434\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0438\u0437 \u043c\u0438\u0440\u0430 .NET. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e:  <\/p>\n<ul>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.internalsvisibletoattribute(v=vs.110).aspx\">InternalsVisibleToAttribute<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.typeforwardedtoattribute(v=vs.110).aspx\">TypeForwardedToAttribute<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.callermembernameattribute(v=vs.110).aspx\">CallerMemberNameAttribute<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.runtime.compilerservices.methodimplattribute(v=vs.110).aspx\">MethodImplAttribute<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-201396","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=201396"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201396\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=201396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=201396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=201396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}