{"id":331069,"date":"2022-03-25T15:00:12","date_gmt":"2022-03-25T15:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=331069"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=331069","title":{"rendered":"<span>\u0418\u0449\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 C# \u043a\u043e\u0434\u0435 GUI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Eto.Forms<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c GUI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f .NET \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0451\u0442 \u2013 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435, \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0435. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 C# \u043a\u043e\u0434\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u2013 Eto.Forms.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/024\/c7c\/193\/024c7c1939b67dc789ff16fb521f1134.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/024\/c7c\/193\/024c7c1939b67dc789ff16fb521f1134.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>Eto.Forms (\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e Eto) \u2013 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 GUI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 C# \u0438 XAML \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0421\u0430\u043c \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C#. \u0412\u0430\u0436\u043d\u043e\u0439 \u0447\u0435\u0440\u0442\u043e\u0439 Eto \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u044b\u0445 \u041e\u0421: Windows, Linux \u0438 macOS. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c Android \u0438 iOS \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, <a href=\"https:\/\/pvs-studio.com\/ru\/\">PVS-Studio<\/a> \u2013 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043d\u0430\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0437\u043e\u0440\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u041e\u0421. \u041a\u0440\u043e\u043c\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \ud83d\ude42<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0435\u0440\u0441\u0438\u0438 7.17 \u0438 <a href=\"https:\/\/github.com\/picoe\/Eto\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 Eto.Forms<\/a> \u043e\u0442 10.02.2022.<\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 GUI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 C#:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0701\/\">Avalonia UI<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0400\/\">Xamarin.Forms<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0653\/\">Windows Forms<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h3>\n<h4>Issue 1<\/h4>\n<p>\u0414\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e:<\/p>\n<pre><code class=\"cs\">\/\/\/ &lt;summary> \/\/\/ .... \/\/\/ &lt;\/summary> \/\/\/ .... \/\/\/ &lt;returns>True if successful,  \/\/\/ or false if the value could not be parsed \/\/ &lt;\/returns> public static bool TryParse(string value, out DashStyle style) {   if (string.IsNullOrEmpty(value))   {     style = DashStyles.Solid;     return true;   }    switch (value.ToUpperInvariant())   {     case \"SOLID\":         style = DashStyles.Solid;         return true;       case \"DASH\":         style = DashStyles.Dash;         return true;       case \"DOT\":         style = DashStyles.Dot;         return true;       case \"DASHDOT\":         style = DashStyles.DashDot;         return true;       case \"DASHDOTDOT\":         style = DashStyles.DashDotDot;         return true;   }   var values = value.Split(',');   if (values.Length == 0)   {     style = DashStyles.Solid;     return true;   }   float offset;   if (!float.TryParse(values[0], out offset))     throw new ArgumentOutOfRangeException(\"value\", value);   float[] dashes = null;   if (values.Length > 1)   {     dashes = new float [values.Length - 1];     for (int i = 0; i &lt; dashes.Length; i++)     {       float dashValue;       if (!float.TryParse(values[i + 1], out dashValue))         throw new ArgumentOutOfRangeException(\"value\", value);       dashes[i] = dashValue;     }   }    style = new DashStyle(offset, dashes);   return true; }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3009\/\">V3009<\/a> It&#8217;s odd that this method always returns one and the same value of &#8216;true&#8217;. Eto DashStyle.cs 56<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043b, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <em>true<\/em> \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438\u0445 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c. \u041d\u0430\u0447\u043d\u0443 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c &#171;TryParse&#187; \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0432\u043e\u0437\u0432\u0440\u0430\u0442 <em>bool<\/em>;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u043b\u0438\u0447\u0438\u0435 <em>out<\/em>-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <em>true<\/em>, \u0430 <em>out<\/em>-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <em>false<\/em>, \u0430 <em>out<\/em>-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <em>default<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0439 <em>bool<\/em> \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/standard\/design-guidelines\/exceptions-and-performance\">\u043e\u043f\u0438\u0441\u0430\u043d<\/a> \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Microsoft. \u041e\u043d \u0431\u044b\u043b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u0438\u043d\u0430\u0447\u0435 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u042d\u0442\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 Try-Parse \u2013 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u043c\u0443. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 &#171;TryParse&#187; \u043e\u043f\u0430\u0441\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u0437\u043d\u0430\u044e\u0449\u0438\u0445 \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d.<\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0435\u0441\u0442\u044c XML-\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: <em>&lt;returns>True if successful, or false if the value could not be parsed&lt;\/returns><\/em>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u043d \u043d\u0435\u0441\u0451\u0442 \u043b\u043e\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<h4>Issue 2<\/h4>\n<pre><code class=\"cs\">public static IEnumerable&lt;IPropertyDescriptor> GetProperties(Type type) {   if (s_GetPropertiesMethod != null)     ((ICollection)s_GetPropertiesMethod.Invoke(null, new object[] { type }))                                        .OfType&lt;object>()                                        .Select(r => Get(r));  \/\/ &lt;=   return type.GetRuntimeProperties().Select(r => Get(r)); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3010\/\">V3010<\/a> The return value of function &#8216;Select&#8217; is required to be utilized. Eto PropertyDescriptorHelpers.cs 209<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Select<\/em> \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p><em>Select<\/em> \u2013 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 LINQ-\u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 <em>IEnumerable&lt;T><\/em>. \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c <em>Select<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u0446\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u2013 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0412\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>Get<\/em> \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b, \u043d\u043e \u0438\u0437-\u0437\u0430 \u043b\u0435\u043d\u0438\u0432\u043e\u0441\u0442\u0438 LINQ \u043d\u0438 \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <em>Get<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d. \u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430 \u0443\u0436\u0435 \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>Get<\/em>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u043b\u044f\u043c\u0431\u0434\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>IPropertyDescriptor<\/em>:<\/p>\n<pre><code class=\"cs\">public static IPropertyDescriptor Get(object obj) {   if (obj is PropertyInfo propertyInfo)     return new PropertyInfoDescriptor(propertyInfo);   else     return PropertyDescriptorDescriptor.Get(obj); }<\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0438\u0442, \u0442\u0438\u043f\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043c <em>Select<\/em> \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 <em>IEnumerable&lt;IPropertyDescriptor><\/em>. \u042d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0442\u0438\u043f, \u043a\u0430\u043a \u0438 \u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <em>GetProperties<\/em>, \u0434\u043b\u044f \u043a\u043e\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0434\u0435\u0441\u044c \u0431\u044b\u043b \u043f\u043e\u0442\u0435\u0440\u044f\u043d <em>return<\/em>:<\/p>\n<pre><code class=\"cs\">public static IEnumerable&lt;IPropertyDescriptor> GetProperties(Type type) {   if (s_GetPropertiesMethod != null)     return       ((ICollection)s_GetPropertiesMethod.Invoke(null, new object[] { type }))                                         .OfType&lt;object>()                                         .Select(r => Get(r));   return type.GetRuntimeProperties().Select(r => Get(r)); }<\/code><\/pre>\n<h4>Issue 3<\/h4>\n<pre><code class=\"cs\">public override string Text {   get { return base.Text; }   set   {     var oldText = Text;     var newText = value ?? string.Empty;               \/\/ &lt;=     if (newText != oldText)     {       var args = new TextChangingEventArgs(oldText, newText, false);       Callback.OnTextChanging(Widget, args);       if (args.Cancel)         return;       base.Text = value;       if (AutoSelectMode == AutoSelectMode.Never)         Selection = new Range&lt;int>(value.Length,       \/\/ &lt;=                                    value.Length - 1);  \/\/ &lt;=     }   }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3125\/\">V3125<\/a> The &#8216;value&#8217; object was used after it was verified against null. Check lines: 329, 320. Eto.WinForms(net462) TextBoxHandler.cs 329<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u043d\u0430 <em>null<\/em>, \u043d\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0435\u0441\u043b\u0438 <em>value<\/em> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d <em>null<\/em>?<\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>value<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e null-coalescing \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0421\u0442\u0440\u043e\u043a\u0430 <em>newText<\/em> \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>string.Empty<\/em>. \u0415\u0441\u043b\u0438 <em>oldText<\/em> \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u0442 \u0432 <em>then<\/em>-\u0432\u0435\u0442\u043a\u0443. \u0412\u043d\u0443\u0442\u0440\u0438 \u0432\u0435\u0442\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 <em>null<\/em> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443:<\/p>\n<pre><code class=\"cs\">base.Text = value;<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0443\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u0420\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>value<\/em> \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430 <em>null<\/em>, \u0438 \u0431\u044b\u043b\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>newText<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>null<\/em>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>newText<\/em>.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0451. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434 \u0434\u0430\u043b\u044c\u0448\u0435. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0438\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <em>value<\/em>:<\/p>\n<pre><code class=\"cs\">Selection = new Range&lt;int>(value.Length,  \/\/ &lt;=                            value.Length - 1);<\/code><\/pre>\n<p>\u0418 \u0442\u0443\u0442 <em>value<\/em> \u0432\u0441\u0451 \u0435\u0449\u0451 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>. \u0415\u0441\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 <em>value<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0431\u0440\u043e\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <em>NullReferenceException<\/em>.<\/p>\n<h4>Issue 4<\/h4>\n<pre><code class=\"cs\">protected virtual void OnChanging(BindingChangingEventArgs e) {   if (Changing != null)     Changing(this, e); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3083\/\">V3083<\/a> Unsafe invocation of event &#8216;Changing&#8217;, NullReferenceException is possible. Consider assigning event to a local variable before invoking it. Eto Binding.cs 80<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432.<\/p>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <em>if (Changing != null)<\/em>, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u043c. \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u044f\u0432\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public event EventHandler&lt;BindingChangingEventArgs> Changing;<\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0442\u0430\u043a\u0436\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439:<\/p>\n<pre><code class=\"cs\">public abstract partial class Binding<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>public<\/em> \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f <em>Changing<\/em> \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u0434\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>Invoke<\/em> \u0438 Elvis operator \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f:<\/p>\n<pre><code class=\"cs\">protected virtual void OnChanging(BindingChangingEventArgs e) {   Changing?.Invoke(this, e); }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0436\u0435 \u0441 \u043d\u0435\u0439:<\/p>\n<pre><code class=\"cs\">protected virtual void OnChanging(BindingChangingEventArgs e) {   EventHandler&lt;BindingChangingEventArgs> safeChanging = Changing;   if (safeChanging != null)     safeChanging(this, e); }<\/code><\/pre>\n<h4>Issue 5<\/h4>\n<pre><code class=\"cs\">void UpdateColumnSizing(....) {   ....   switch (FixedPanel)   {     case SplitterFixedPanel.Panel1:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));  \/\/ &lt;=       break;     case SplitterFixedPanel.Panel2:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));  \/\/ &lt;=       break;     case SplitterFixedPanel.None:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));       SetLength(2, new sw.GridLength(1, sw.GridUnitType.Star));       break;   }   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3139\/\">V3139<\/a> Two or more case-branches perform the same actions. Eto.Wpf(net462) SplitterHandler.cs 357<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>switch<\/em>, \u0433\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 <em>case<\/em>-\u0432\u0435\u0442\u0432\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p><em>switch<\/em> \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 3 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <em>SplitterFixedPanel<\/em>, \u0434\u0432\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u044e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 <em>Panel1<\/em> \u0438 <em>Panel2<\/em>. \u0412 \u043e\u0431\u0435\u0438\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <em>SetLength<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"cs\">void SetLength(int panel, sw.GridLength value)<\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <em>panel<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <em>SetLength<\/em>:<\/p>\n<pre><code class=\"cs\">Control.ColumnDefinitions[panel] = ....<\/code><\/pre>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0432\u0435\u0442\u0432\u044c \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <em>None<\/em>. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0443, \u043e\u043d \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0435\u0438\u0445 \u043f\u0430\u043d\u0435\u043b\u0435\u0439. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b &#171;0&#187; \u0438 &#171;2&#187; \u0432\u043f\u043e\u043b\u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043e\u043c &#171;SplitContainer&#187;. \u0427\u0438\u0441\u043b\u043e &#171;1&#187; \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u043c\u0443 \u0442\u0443\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"cs\">void UpdateColumnSizing(....) {   ....   switch (FixedPanel)   {     case SplitterFixedPanel.Panel1:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));       break;     case SplitterFixedPanel.Panel2:       SetLength(2, new sw.GridLength(1, sw.GridUnitType.Star));       break;     case SplitterFixedPanel.None:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));       SetLength(2, new sw.GridLength(1, sw.GridUnitType.Star));       break;   }   .... }<\/code><\/pre>\n<h4>Issue 6<\/h4>\n<pre><code class=\"cs\">public Font SelectionFont {   get   {     ....     Pango.FontDescription fontDesc = null;     ....     foreach (var face in family.Faces)     {       var faceDesc = face.Describe();       if (   faceDesc.Weight == weight            &amp;&amp; faceDesc.Style == style            &amp;&amp; faceDesc.Stretch == stretch)       {         fontDesc = faceDesc;         break;       }     }     if (fontDesc == null)       fontDesc = family.Faces[0]?.Describe();   \/\/ &lt;=     var fontSizeTag = GetTag(FontSizePrefix);     fontDesc.Size =   fontSizeTag != null       \/\/ &lt;=                     ? fontSizeTag.Size                     : (int)(Font.Size * Pango.Scale.PangoScale);     ....   } }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3105\/\">V3105<\/a> The &#8216;fontDesc&#8217; variable was used after it was assigned through null-conditional operator. NullReferenceException is possible. Eto.Gtk3 RichTextAreaHandler.cs 328<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0438 \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f null-conditional \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>fontDesc<\/em> \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f <em>null<\/em>. \u0415\u0441\u043b\u0438 \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0432 \u0446\u0438\u043a\u043b\u0435 <em>foreach<\/em>, \u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0432\u0435\u0442\u043a\u0430, \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f <em>fontDesc<\/em>. \u041d\u043e \u043a\u043e\u0434 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 null-conditional (Elvis) \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440:<\/p>\n<pre><code class=\"cs\">fontDesc = family.Faces[0]?.Describe();<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>, \u0442\u043e <em>fontDesc<\/em> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d <em>null<\/em>. \u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cs\">fontDesc.Size = ....<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 <em>fontDesc<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>, \u0442\u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>Size<\/em> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <em>NullReferenceException<\/em>.<\/p>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e null-conditional \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043e\u0442 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438\u043b\u0438 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432 <em>family.Faces[0]<\/em> \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f <em>null<\/em>, \u0442\u043e \u0432\u044b\u0431\u0440\u043e\u0441 <em>NullReferenceException<\/em> \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0435\u0449\u0451 \u0432 \u0446\u0438\u043a\u043b\u0435 <em>foreach<\/em>. \u0422\u0430\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cs\">foreach (var face in family.Faces) {   var faceDesc = face.Describe(); \/\/ &lt;=   if (   faceDesc.Weight == weight        &amp;&amp; faceDesc.Style == style        &amp;&amp; faceDesc.Stretch == stretch)   {     fontDesc = faceDesc;     break;   } }<\/code><\/pre>\n<h4>Issue 7<\/h4>\n<pre><code class=\"cs\">public override NSObject GetObjectValue(object dataItem) {   float? progress = Widget.Binding.GetValue(dataItem);  \/\/ &lt;=   if (Widget.Binding != null &amp;&amp; progress.HasValue)      \/\/ &lt;=   {     progress = progress &lt; 0f ? 0f : progress > 1f ? 1f : progress;     return new NSNumber((float)progress);   }   return new NSNumber(float.NaN); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3095\/\">V3095<\/a> The &#8216;Widget.Binding&#8217; object was used before it was verified against null. Check lines: 42, 43. Eto.Mac64 ProgressCellHandler.cs 42<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u0435\u0451 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 <em>null<\/em>.<\/p>\n<p>\u0415\u0441\u043b\u0438 <em>Widget.Binding<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>, \u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>GetValue<\/em> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>NullReferenceException<\/em>. \u041d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f\u0441\u044f \u043d\u0438\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>Widget.Binding != null<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 Elvis \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u0411\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"cs\">public override NSObject GetObjectValue(object dataItem) {   float? progress = Widget.Binding?.GetValue(dataItem);   if (progress.HasValue)   {     progress =   progress &lt; 0f                 ? 0f                 : (progress > 1f                    ? 1f                    : progress);     return new NSNumber((float)progress);   }   return new NSNumber(float.NaN); }<\/code><\/pre>\n<h4>Issue 8<\/h4>\n<p>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"cs\">public bool Enabled {   get { return Control != null ? enabled : Control.Sensitive; }   set {     if (Control != null)       Control.Sensitive = value;     else       enabled = value;   } }<\/code><\/pre>\n<p>\u0413\u0434\u0435 \u0436\u0435 \u043e\u043d\u0430?<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/429\/9c2\/05f\/4299c205f0a3eea12af64acccd752c3b.png\" width=\"358\" height=\"395\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/429\/9c2\/05f\/4299c205f0a3eea12af64acccd752c3b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c:<\/p>\n<pre><code class=\"cs\">get { return Control != null ? enabled : Control.Sensitive; }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3080\/\">V3080<\/a> Possible null dereference. Consider inspecting &#8216;Control&#8217;. Eto.Gtk3 RadioMenuItemHandler.cs 143<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u0430 \u0438 \u043d\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043e\u0442 <em>NullReferenceException<\/em>. \u0412 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043b\u043e\u0436\u043d\u043e, \u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041a\u043e\u0433\u0434\u0430 <em>Control<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>, \u0442\u043e\u0433\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0436\u043d\u044b\u043c \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u2013 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 <em>NullReferenceException<\/em>.<\/p>\n<h4>Issue 9<\/h4>\n<pre><code class=\"cs\">public NSShadow TextHighlightShadow {   get   {     if (textHighlightShadow == null)     {       textHighlightShadow = new NSShadow();       textHighlightShadow.ShadowColor = NSColor.FromDeviceWhite(0F, 0.5F);       textHighlightShadow.ShadowOffset = new CGSize(0F, -1.0F);       textHighlightShadow.ShadowBlurRadius = 2F;     }     return textHighlightShadow;   }   set { textShadow = value; } }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3140\/\">V3140<\/a> Property accessors use different backing fields. Eto.Mac64 MacImageAndTextCell.cs 162<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0432 \u0441\u0435\u0442\u0442\u0435\u0440\u0435 \u0438 \u0433\u0435\u0442\u0442\u0435\u0440\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u043b\u044f. \u0412 \u0441\u0435\u0442\u0442\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <em>textShadow<\/em>, \u0430 \u0432 \u0433\u0435\u0442\u0442\u0435\u0440\u0435 \u2013 <em>textHighlightShadow<\/em>. \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u2013 <em>TextHighlightShadow<\/em>, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>textHighlightShadow<\/em>. \u0412\u043e\u0442 \u0435\u0433\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cs\">public class MacImageListItemCell : EtoLabelFieldCell {   ....   NSShadow textHighlightShadow; }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0435 <em>textHighlightShadow<\/em> \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>TextHighlightShadow<\/em>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c. \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0433\u0434\u0430 <em>textHighlightShadow<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>null<\/em>, \u0433\u0435\u0442\u0442\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0435\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>TextShadow<\/em>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u043e\u043b\u0435\u043c <em>textShadow<\/em>:<\/p>\n<pre><code class=\"cs\">public NSShadow TextShadow {   get   {     if (textShadow == null)     {       textShadow = new NSShadow();       textShadow.ShadowColor = NSColor.FromDeviceWhite(1F, 0.5F);       textShadow.ShadowOffset = new CGSize(0F, -1.0F);       textShadow.ShadowBlurRadius = 0F;     }     return textShadow;   }   set { textShadow = value; } }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u0441\u0435\u0442\u0442\u0435\u0440\u0435 <em>TextHighlightShadow<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435 <em>textShadow<\/em>, \u0442\u043e \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 <em>TextHighlightShadow<\/em> \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0438 <em>TextShadow<\/em>. \u0421\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0440\u0435\u0448\u0438\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h4>Issue 10<\/h4>\n<pre><code class=\"cs\">public static NSImage ToNS(this Image image, int? size = null) {   ....   if (size != null)   {     ....     var sz = (float)Math.Ceiling(size.Value \/ mainScale);  \/\/ &lt;=     sz = size.Value;  \/\/ &lt;=   }   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3008\/\">V3008<\/a> The &#8216;sz&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 296, 295. Eto.Mac64 MacConversions.cs 296<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043b, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0438\u043c\u0435\u044e\u0449\u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u043e\u0435, \u0445\u043e\u0442\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438\u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e.<\/p>\n<p>\u041d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>sz<\/em>. \u0418 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>sz<\/em> \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u043c.<\/p>\n<h4>Issue 11<\/h4>\n<pre><code class=\"cs\">public static IBinding BindingOfType(....) {   ....   var ofTypeMethod = bindingType.GetRuntimeMethods()                                 .FirstOrDefault(....);   return (IBinding)ofTypeMethod.MakeGenericMethod(toType)                                .Invoke(...); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3146\/\">V3146<\/a> Possible null dereference of &#8216;ofTypeMethod&#8217;. The &#8216;FirstOrDefault&#8217; can return default null value. Eto BindingExtensionsNonGeneric.cs 21<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>FirstOrDefault<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>ofTypeMethod<\/em>, \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>null<\/em>. \u0420\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <em>ofTypeMethod<\/em> \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0432\u044b\u0431\u0440\u043e\u0441\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <em>NullReferenceException<\/em>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>First<\/em>:<\/p>\n<pre><code class=\"cs\">var ofTypeMethod = bindingType.GetRuntimeMethods()                                .First(r =>                                           r.Name == \"OfType\"                                       &amp;&amp; r.GetParameters().Length == 2);<\/code><\/pre>\n<p>\u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0435\u0441\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439 \u043d\u0435\u0442 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d, \u0442\u043e <em>First<\/em> \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442 <em>InvalidOperationException<\/em>. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043f\u043e\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435: <em>NullReferenceException<\/em> \u0438\u043b\u0438 <em>InvalidOperationException<\/em>? \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043a\u043e\u0434\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f .NET \u0431\u044b\u043b\u0430 \u043a\u0440\u0435\u043f\u043a\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u043a Windows, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432 \u0442\u043e\u0439 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c GUI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 Mono, Xamarin \u0438, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, .NET Core. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0436\u0435\u043b\u0430\u043d\u0438\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u0431\u044b\u043b\u043e \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 GUI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0441 Windows \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u041f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 C# \u0438 XAML \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438: Avalonia UI, Uno Platform \u0438 Eto.Forms. \u0418, \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u043f\u043e\u0445\u043e\u0436\u0435\u043c \u043d\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e \u043d\u0451\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0414\u0430\u0436\u0435 \u043a\u0430\u043a-\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u0436\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0438\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u0438, \u043d\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f \u2013 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n<p>PVS-Studio \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0435\u0435. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432 \u043d\u0435\u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/0600\/\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e<\/a>.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043c\u043e\u0433\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c <a href=\"https:\/\/pvs-studio.com\/pvs-studio\/try-free\/?utm_source=habr&amp;utm_medium=articles&amp;utm_content=eto_forms&amp;utm_term=link_try_free\">\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c PVS-Studio<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u044b.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0443\u0432\u0438\u0434\u0438\u043c\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Vadim Kuleshov. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/0929\/\">Looking for errors in the C# code of the Eto.Forms GUI framework<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/657477\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/657477\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c GUI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f .NET \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0451\u0442 \u2013 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435, \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0435. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 C# \u043a\u043e\u0434\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u2013 Eto.Forms.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>Eto.Forms (\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e Eto) \u2013 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 GUI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 C# \u0438 XAML \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0421\u0430\u043c \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C#. \u0412\u0430\u0436\u043d\u043e\u0439 \u0447\u0435\u0440\u0442\u043e\u0439 Eto \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u044b\u0445 \u041e\u0421: Windows, Linux \u0438 macOS. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c Android \u0438 iOS \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, <a href=\"https:\/\/pvs-studio.com\/ru\/\">PVS-Studio<\/a> \u2013 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043d\u0430\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0437\u043e\u0440\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u041e\u0421. \u041a\u0440\u043e\u043c\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \ud83d\ude42<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u0435\u0440\u0441\u0438\u0438 7.17 \u0438 <a href=\"https:\/\/github.com\/picoe\/Eto\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 Eto.Forms<\/a> \u043e\u0442 10.02.2022.<\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 GUI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 C#:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0701\/\">Avalonia UI<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0400\/\">Xamarin.Forms<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0653\/\">Windows Forms<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/h3>\n<h4>Issue 1<\/h4>\n<p>\u0414\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e:<\/p>\n<pre><code class=\"cs\">\/\/\/ &lt;summary> \/\/\/ .... \/\/\/ &lt;\/summary> \/\/\/ .... \/\/\/ &lt;returns>True if successful,  \/\/\/ or false if the value could not be parsed \/\/ &lt;\/returns> public static bool TryParse(string value, out DashStyle style) {   if (string.IsNullOrEmpty(value))   {     style = DashStyles.Solid;     return true;   }    switch (value.ToUpperInvariant())   {     case \"SOLID\":         style = DashStyles.Solid;         return true;       case \"DASH\":         style = DashStyles.Dash;         return true;       case \"DOT\":         style = DashStyles.Dot;         return true;       case \"DASHDOT\":         style = DashStyles.DashDot;         return true;       case \"DASHDOTDOT\":         style = DashStyles.DashDotDot;         return true;   }   var values = value.Split(',');   if (values.Length == 0)   {     style = DashStyles.Solid;     return true;   }   float offset;   if (!float.TryParse(values[0], out offset))     throw new ArgumentOutOfRangeException(\"value\", value);   float[] dashes = null;   if (values.Length > 1)   {     dashes = new float [values.Length - 1];     for (int i = 0; i &lt; dashes.Length; i++)     {       float dashValue;       if (!float.TryParse(values[i + 1], out dashValue))         throw new ArgumentOutOfRangeException(\"value\", value);       dashes[i] = dashValue;     }   }    style = new DashStyle(offset, dashes);   return true; }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3009\/\">V3009<\/a> It&#8217;s odd that this method always returns one and the same value of &#8216;true&#8217;. Eto DashStyle.cs 56<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u043b, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <em>true<\/em> \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438\u0445 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c. \u041d\u0430\u0447\u043d\u0443 \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c &#171;TryParse&#187; \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p>\u0432\u043e\u0437\u0432\u0440\u0430\u0442 <em>bool<\/em>;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u043b\u0438\u0447\u0438\u0435 <em>out<\/em>-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0431\u0440\u043e\u0441\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <em>true<\/em>, \u0430 <em>out<\/em>-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f <em>false<\/em>, \u0430 <em>out<\/em>-\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <em>default<\/em>-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0439 <em>bool<\/em> \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/standard\/design-guidelines\/exceptions-and-performance\">\u043e\u043f\u0438\u0441\u0430\u043d<\/a> \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Microsoft. \u041e\u043d \u0431\u044b\u043b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u0438\u043d\u0430\u0447\u0435 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u042d\u0442\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 Try-Parse \u2013 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u043c\u0443. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 &#171;TryParse&#187; \u043e\u043f\u0430\u0441\u043d\u043e \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u0437\u043d\u0430\u044e\u0449\u0438\u0445 \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d.<\/p>\n<p>\u041a \u0441\u043b\u043e\u0432\u0443, \u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0435\u0441\u0442\u044c XML-\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: <em>&lt;returns>True if successful, or false if the value could not be parsed&lt;\/returns><\/em>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u043d \u043d\u0435\u0441\u0451\u0442 \u043b\u043e\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<h4>Issue 2<\/h4>\n<pre><code class=\"cs\">public static IEnumerable&lt;IPropertyDescriptor> GetProperties(Type type) {   if (s_GetPropertiesMethod != null)     ((ICollection)s_GetPropertiesMethod.Invoke(null, new object[] { type }))                                        .OfType&lt;object>()                                        .Select(r => Get(r));  \/\/ &lt;=   return type.GetRuntimeProperties().Select(r => Get(r)); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3010\/\">V3010<\/a> The return value of function &#8216;Select&#8217; is required to be utilized. Eto PropertyDescriptorHelpers.cs 209<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Select<\/em> \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p><em>Select<\/em> \u2013 \u044d\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0437 LINQ-\u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 <em>IEnumerable&lt;T><\/em>. \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c <em>Select<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u0446\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u2013 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0412\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>Get<\/em> \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b, \u043d\u043e \u0438\u0437-\u0437\u0430 \u043b\u0435\u043d\u0438\u0432\u043e\u0441\u0442\u0438 LINQ \u043d\u0438 \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <em>Get<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d. \u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430 \u0443\u0436\u0435 \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>Get<\/em>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u043b\u044f\u043c\u0431\u0434\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>IPropertyDescriptor<\/em>:<\/p>\n<pre><code class=\"cs\">public static IPropertyDescriptor Get(object obj) {   if (obj is PropertyInfo propertyInfo)     return new PropertyInfoDescriptor(propertyInfo);   else     return PropertyDescriptorDescriptor.Get(obj); }<\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0438\u0442, \u0442\u0438\u043f\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043c <em>Select<\/em> \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 <em>IEnumerable&lt;IPropertyDescriptor><\/em>. \u042d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0442\u0438\u043f, \u043a\u0430\u043a \u0438 \u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <em>GetProperties<\/em>, \u0434\u043b\u044f \u043a\u043e\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0434\u0435\u0441\u044c \u0431\u044b\u043b \u043f\u043e\u0442\u0435\u0440\u044f\u043d <em>return<\/em>:<\/p>\n<pre><code class=\"cs\">public static IEnumerable&lt;IPropertyDescriptor> GetProperties(Type type) {   if (s_GetPropertiesMethod != null)     return       ((ICollection)s_GetPropertiesMethod.Invoke(null, new object[] { type }))                                         .OfType&lt;object>()                                         .Select(r => Get(r));   return type.GetRuntimeProperties().Select(r => Get(r)); }<\/code><\/pre>\n<h4>Issue 3<\/h4>\n<pre><code class=\"cs\">public override string Text {   get { return base.Text; }   set   {     var oldText = Text;     var newText = value ?? string.Empty;               \/\/ &lt;=     if (newText != oldText)     {       var args = new TextChangingEventArgs(oldText, newText, false);       Callback.OnTextChanging(Widget, args);       if (args.Cancel)         return;       base.Text = value;       if (AutoSelectMode == AutoSelectMode.Never)         Selection = new Range&lt;int>(value.Length,       \/\/ &lt;=                                    value.Length - 1);  \/\/ &lt;=     }   }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3125\/\">V3125<\/a> The &#8216;value&#8217; object was used after it was verified against null. Check lines: 329, 320. Eto.WinForms(net462) TextBoxHandler.cs 329<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u043d\u0430 <em>null<\/em>, \u043d\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0435\u0441\u043b\u0438 <em>value<\/em> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u0435\u043d <em>null<\/em>?<\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>value<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e null-coalescing \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0421\u0442\u0440\u043e\u043a\u0430 <em>newText<\/em> \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>string.Empty<\/em>. \u0415\u0441\u043b\u0438 <em>oldText<\/em> \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043b \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u0442 \u0432 <em>then<\/em>-\u0432\u0435\u0442\u043a\u0443. \u0412\u043d\u0443\u0442\u0440\u0438 \u0432\u0435\u0442\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 <em>null<\/em> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443:<\/p>\n<pre><code class=\"cs\">base.Text = value;<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0443\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u0420\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>value<\/em> \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430 <em>null<\/em>, \u0438 \u0431\u044b\u043b\u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>newText<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>null<\/em>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>newText<\/em>.<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0451. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434 \u0434\u0430\u043b\u044c\u0448\u0435. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0438\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <em>value<\/em>:<\/p>\n<pre><code class=\"cs\">Selection = new Range&lt;int>(value.Length,  \/\/ &lt;=                            value.Length - 1);<\/code><\/pre>\n<p>\u0418 \u0442\u0443\u0442 <em>value<\/em> \u0432\u0441\u0451 \u0435\u0449\u0451 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>. \u0415\u0441\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 <em>value<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null<\/em>, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0431\u0440\u043e\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <em>NullReferenceException<\/em>.<\/p>\n<h4>Issue 4<\/h4>\n<pre><code class=\"cs\">protected virtual void OnChanging(BindingChangingEventArgs e) {   if (Changing != null)     Changing(this, e); }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3083\/\">V3083<\/a> Unsafe invocation of event &#8216;Changing&#8217;, NullReferenceException is possible. Consider assigning event to a local variable before invoking it. Eto Binding.cs 80<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432.<\/p>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <em>if (Changing != null)<\/em>, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u043c. \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u044f\u0432\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public event EventHandler&lt;BindingChangingEventArgs> Changing;<\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0442\u0430\u043a\u0436\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439:<\/p>\n<pre><code class=\"cs\">public abstract partial class Binding<\/code><\/pre>\n<p>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <em>public<\/em> \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f <em>Changing<\/em> \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u0434\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>Invoke<\/em> \u0438 Elvis operator \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f:<\/p>\n<pre><code class=\"cs\">protected virtual void OnChanging(BindingChangingEventArgs e) {   Changing?.Invoke(this, e); }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0436\u0435 \u0441 \u043d\u0435\u0439:<\/p>\n<pre><code class=\"cs\">protected virtual void OnChanging(BindingChangingEventArgs e) {   EventHandler&lt;BindingChangingEventArgs> safeChanging = Changing;   if (safeChanging != null)     safeChanging(this, e); }<\/code><\/pre>\n<h4>Issue 5<\/h4>\n<pre><code class=\"cs\">void UpdateColumnSizing(....) {   ....   switch (FixedPanel)   {     case SplitterFixedPanel.Panel1:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));  \/\/ &lt;=       break;     case SplitterFixedPanel.Panel2:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));  \/\/ &lt;=       break;     case SplitterFixedPanel.None:       SetLength(0, new sw.GridLength(1, sw.GridUnitType.Star));       SetLength(2, new sw.GridLength(1, sw.GridUnitType.Star));       break;   }   .... }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3139\/\">V3139<\/a> Two or more case-branches perform the same actions. Eto.Wpf(net462) SplitterHandler.cs 357<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>switch<\/em>, \u0433\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 <em>case<\/em>-\u0432\u0435\u0442\u0432\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<p><em>switch<\/em> \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 3 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <em>SplitterFixedPanel<\/em>, \u0434\u0432\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u044e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 <em>Panel1<\/em> \u0438 <em>Panel2<\/em>. \u0412 \u043e\u0431\u0435\u0438\u0445 \u0432\u0435\u0442\u043a\u0430\u0445 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <em>SetLength<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"cs\">void SetLength(int panel, sw.GridLength value)<\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <em>panel<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <em>SetLength<\/em>:<\/p>\n<pre><code class=\"cs\">Control.ColumnDefinitions[panel] = ....<\/code><\/pre>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0432\u0435\u0442\u0432\u044c \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <em>None<\/em>. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0443, \u043e\u043d \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0435\u0438\u0445 \u043f\u0430\u043d\u0435\u043b\u0435\u0439. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b &#171;0&#187; \u0438 &#171;2&#187; \u0432\u043f\u043e\u043b\u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-331069","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331069","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=331069"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331069\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}