{"id":191926,"date":"2013-09-05T14:31:02","date_gmt":"2013-09-05T10:31:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=191926"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=191926","title":{"rendered":"<span class=\"post_title\">C# async \u0434\u043b\u044f iOS \u0438 Android<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       Xamarin \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/hh191443.aspx\">C# 5 Async\/await<\/a> \u043d\u0430 iOS \u0438 Android. \u041a\u0440\u043e\u043c\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 .NET Async, \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c 174 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 Xamarin.iOS \u0438 337 \u0432 Xamarin.Android. \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u0442\u0430\u043a \u0436\u0435 \u0441\u0442\u0430\u043b <a href=\"http:\/\/xamarin.com\/mobileapi\">Xamarin Mobile<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0435, \u043a\u0430\u043c\u0435\u0440\u0435 \u0438 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438. <a href=\"http:\/\/components.xamarin.com\/\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/a> \u0432\u043e\u0432\u0441\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 async, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 backend <a href=\"http:\/\/components.xamarin.com\/view\/parse\/\">Parse<\/a>.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 <a href=\"http:\/\/blog.xamarin.com\/csharp-async-on-ios-and-android\/\">\u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430<\/a> \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/dd8\/827\/942\/dd88279421732391b81adff42c27eb77.png\"\/><br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0445\u043e\u0442\u044f\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. <\/p>\n<p>  \u041e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0434\u043e\u043b\u044c\u0448\u0435 64 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043a\u0446\u0438\u044f \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014\u00a0\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u043b\u0433\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435. \u0410 \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043f\u043e\u0442\u043e\u043a\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u0438 \u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443, \u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0435 \u0437\u0430\u043d\u043e\u0432\u043e.<\/p>\n<p>  \u041f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0439: \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0410 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e \u0441\u0435\u0442\u0438, \u0432\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044d\u0442\u043e \u0437\u0430\u0439\u043c\u0435\u0442. \u0418 \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u043f\u043e\u0437\u0436\u0435 \u0447\u0435\u043c \u0437\u0430 64 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043c\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u043a\u043e\u043b\u043b-\u0431\u0435\u043a\u0438. \u041e\u043d\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b \u0441 \u043f\u043e\u0434\u0430\u0447\u0438 NodeJS. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u043b-\u0431\u0435\u043a\u043e\u0432, \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f <a href=\"https:\/\/twitter.com\/marcoarment\/status\/365683181069942784\">\u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c<\/a> \u0438 \u0441\u043b\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c\u044b\u043c, \u044d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"http:\/\/callbackhell.com\/\">Callback Hell<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/7a8\/8e2\/157\/7a88e215788cad04a3709b401c85d1a7.jpg\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u0443\u0441\u043a\u0430 \u043a\u043e\u0434\u0430 \u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d \u0438 \u0441\u043b\u043e\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u041c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0446\u0438\u043a\u043b\u0430\u0445, \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0431\u043b\u043e\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0443 \u043c\u0435\u043d\u044f \u0431\u043e\u043b\u0438\u0442 \u0433\u043e\u043b\u043e\u0432\u0430 \u043a\u043e\u0433\u0434\u0430 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0443\u043c\u0430\u044e \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0418 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u042f \u043d\u0435 \u0445\u043e\u0447\u0443 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u044f \u0441\u0434\u0430\u044e\u0441\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/34e\/4ce\/523\/34e4ce523d799857f09758c9c917f348.jpg\" align=\"left\"\/><br \/>  <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B5%D0%B9%D0%BA%D1%81%D1%82%D1%80%D0%B0,_%D0%AD%D0%B4%D1%81%D0%B3%D0%B5%D1%80_%D0%92%D0%B8%D0%B1%D0%B5\">\u042d\u0434\u0441\u0433\u0435\u0440 \u0414\u0435\u0439\u043a\u0441\u0442\u0440\u0430<\/a>  <\/p>\n<blockquote><p>\u041d\u0430\u0448 \u043c\u043e\u0437\u0433 \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043d\u0430\u0448\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u044b \u043f\u043b\u043e\u0445\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u043e \u0435\u0435 \u043a\u043e\u0434\u0443 \u0431\u044b\u043b\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0449\u0435.<\/p><\/blockquote>\n<p> \u041e\u043d \u0438\u043c\u0435\u043b \u0432\u0432\u0438\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 GOTO, \u0441 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u043e\u0432. \u041d\u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0438\u0434\u0438\u043e\u043c\u044b, \u043d\u043e\u0432\u044b\u0435 \u044f\u0437\u044b\u043a\u0438, \u0443\u0447\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0437\u0430 \u043d\u0430\u0441. \u0418 async\/await \u0432 C# \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u0430\u044f \u0438\u0434\u0438\u043e\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0434\u0442\u0438 \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0430\u043c.<\/p>\n<pre><code class=\"cs\">async Task SnapAndPostAsync() {     try {         Busy = true;         UpdateUIStatus (&quot;Taking a picture&quot;);         var picker = new Xamarin.Media.MediaPicker ();         var mFile = await picker.TakePhotoAsync (new Xamarin.Media.StoreCameraMediaOptions ());         var tagsCtrl = new GetTagsUIViewontroller (mFile.GetStream ());         \/\/ Call new iOS await API         await PresentViewControllerAsync (tagsCtrl, true);         UpdateUIStatus (&quot;Submitting picture to server&quot;);         await PostPicToServiceAsync (mFile.GetStream (), tagsCtrl.Tags);         UpdateUIStatus (&quot;Success&quot;);     } catch (OperationCanceledException) {         UpdateUIStatus (&quot;Canceled&quot;);     } finally {         Busy = false;     } } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f async\/await. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0443\u0434\u0430. \u0410 \u0432\u0441\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u043b\u043e\u0432\u043e async \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u043a\u0430\u043a \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0438 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b await. \u042d\u0442\u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443: \u00ab\u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0441\u0434\u0435\u043b\u0430\u0439 \u0440\u0430\u0431\u043e\u0442\u0443 \u0437\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u043f\u0435\u0440\u0435\u043f\u0438\u0448\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0440\u0430\u0437\u0434\u0435\u043b\u0438 \u0435\u0433\u043e \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043a\u0443\u0441\u043e\u0447\u043a\u043e\u0432\u00bb. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0441\u044f \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0438, \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0410 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u0438 \u0437\u0430\u0432\u0435\u0449\u0430\u043b \u0414\u0435\u0439\u043a\u0441\u0442\u0440\u0430.<\/p>\n<p>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0438\u043f <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/dd321424.aspx\">Task&lt;T&gt;<\/a>. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0432 \u0444\u043e\u043d\u0435. Task \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u0434\u0430\u0447\u0438 (\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430), \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 Task: \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 T. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/b3f\/834\/075\/b3f834075815ddecc658454b8db23a98.jpg\"\/><\/p>\n<p>  \u0421 Task \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0447, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0438\u043b\u0438 \u0432\u0441\u0435\u0445 \u0432\u043c\u0435\u0441\u0442\u0435. \u0418\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c Task \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 Task. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0440\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0435\u0440\u043a\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0445 \u0432 \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043b\u044e\u0431\u0430\u044f \u0438\u0437 \u0442\u0440\u0435\u0445 \u0438 \u0432\u0435\u0440\u043d\u0435\u0442 \u0435\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440. \u041c\u043d\u0435 \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b, \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u043c\u044b \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043d\u0435\u0442, \u0435\u0441\u043b\u0438 \u043e\u043d \u0441\u043a\u0430\u0436\u0435\u0442 \u00ab\u0434\u0430\u00bb\u00a0\u2014 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0430\u0439\u043b, \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<pre><code class=\"cs\">async Task DownloadFile (Uri uri, string target) {     if (File.Exists (target)){         switch (await ShowAlert (&quot;File Exists&quot;, &quot;Do you want to overwrite the file?&quot;, &quot;yes&quot;, &quot;no&quot;)){         case 0:             break;         case 1:             return;         }     }     var stream = await Http.Get (uri);     await stream.SaveTo(target); } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u0432 iOS \u0438 Android \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0435\u0437 async \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u043b\u0431\u0435\u043a. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 async \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441. \u0418 \u044d\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d ShowAlert \u0432\u043d\u0443\u0442\u0440\u0438 Xamarin.  <\/p>\n<pre><code class=\"cs\">public static Task&lt;int&gt; ShowAlert(string title, string message, params string [] buttons) {     var tcs = new TaskCompletionSource&lt;int&gt; ();     var alert = new UIAlertView {             Title = title,             Message = message     };     foreach (var button in buttons)             alert.AddButton (button);     alert.Clicked += (s, e) =&gt; tcs.TrySetResult (e.ButtonIndex);     alert.Show ();     return tcs.Task; }<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u044e \u0441 \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0443, \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u0430\u0433\u0438\u044f. \u0422\u0430\u043a \u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u043e\u043a\u0430\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u043e \u0434\u0443\u043c\u0430\u044e \u043e\u043d\u0430 \u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438.<\/p>\n<p>  \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b Xamarin \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b .NET5 Async \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u0415\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u044b\u043c Xamarin.iOS \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 174 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430 Xamarin.Android \u2014 337. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u0441\u0442\u0430\u043b <a href=\"http:\/\/xamarin.com\/mobileapi\">Xamarin Mobile<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0435, \u043a\u0430\u043c\u0435\u0440\u0435 \u0438 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438. \u041c\u043d\u043e\u0433\u0438\u0435 <a href=\"http:\/\/components.xamarin.com\/\">\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/a> \u0442\u0430\u043a \u0436\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 backend <a href=\"http:\/\/components.xamarin.com\/view\/parse\/\">Parse<\/a>. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 API \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 50 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u043b\u0438\u0431\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>  <b>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 async\/await \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 Xamarin \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 iOS \u0438 Android \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u043c\u0438 \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439.<\/b><\/p>\n<p>  <i>(\u043f\u0440\u0438\u043c. \u043f\u0435\u0440. \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c Craig Dunn, \u043f\u043e\u0445\u043e\u0436\u0435, \u043e\u043d \u043f\u0435\u0440\u0435\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/hh873175.aspx\">Task-based Asynchronous Pattern<\/a>)<\/i><\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/xamarin\/mobile-samples\/blob\/master\/AsyncAwait\">\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 Github<\/a>.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 UI-\u043f\u043e\u0442\u043e\u043a, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u041f\u0444\u0444. \u041a\u043e\u0434 \u0441\u043b\u043e\u0436\u0435\u043d \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"cs\">public void DownloadHomepage() { \tvar webClient = new WebClient();  \twebClient.DownloadStringCompleted += (sender, e) =&gt; { \t\tif(e.Cancelled || e.Error != null) { \t\t\t\/\/ do something with error \t\t} \t\tstring contents = e.Result;  \t\tint length = contents.Length; \t\tInvokeOnMainThread (() =&gt; { \t\t\tResultTextView.Text += &quot;Downloaded the html and found out the length.\\n\\n&quot;; \t\t}); \t\twebClient.DownloadDataCompleted += (sender1, e1) =&gt; { \t\t\tif(e1.Cancelled || e1.Error != null) { \t\t\t\t\/\/ do something with error \t\t\t} \t\t\tSaveBytesToFile(e1.Result, &quot;team.jpg&quot;);  \t\t\tInvokeOnMainThread (() =&gt; { \t\t\t\tResultTextView.Text += &quot;Downloaded the image.\\n&quot;; \t\t\t\tDownloadedImageView.Image = UIImage.FromFile (localPath); \t\t\t});  \t\t\tALAssetsLibrary library = new ALAssetsLibrary();      \t\t\tvar dict = new NSDictionary(); \t\t\tlibrary.WriteImageToSavedPhotosAlbum (DownloadedImageView.Image.CGImage, dict, (s2,e2) =&gt; { \t\t\t\tInvokeOnMainThread (() =&gt; { \t\t\t\t\tResultTextView.Text += &quot;Saved to album assetUrl\\n&quot;; \t\t\t\t}); \t\t\t\tif (downloaded != null) \t\t\t\t\tdownloaded(length); \t\t\t}); \t\t}; \t\twebClient.DownloadDataAsync(new Uri(&quot;http:\/\/xamarin.com\/images\/about\/team.jpg&quot;)); \t};  \twebClient.DownloadStringAsync(new Uri(&quot;http:\/\/xamarin.com\/&quot;)); }<\/code><\/pre>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c async\/await:<\/p>\n<pre><code class=\"cs\">public async Task&lt;int&gt; DownloadHomepageAsync() { \ttry { \t\tvar httpClient = new HttpClient();  \t\tTask&lt;string&gt; contentsTask = httpClient.GetStringAsync(&quot;http:\/\/xamarin.com&quot;);   \t\tstring contents = await contentsTask;  \t\tint length = contents.Length; \t\tResultTextView.Text += &quot;Downloaded the html and found out the length.\\n\\n&quot;;  \t\tbyte[] imageBytes  = await httpClient.GetByteArrayAsync(&quot;http:\/\/xamarin.com\/images\/about\/team.jpg&quot;);  \t\tSaveBytesToFile(imageBytes, &quot;team.jpg&quot;); \t\tResultTextView.Text += &quot;Downloaded the image.\\n&quot;; \t\tDownloadedImageView.Image = UIImage.FromFile (localPath);  \t\tALAssetsLibrary library = new ALAssetsLibrary();      \t\tvar dict = new NSDictionary(); \t\tvar assetUrl = await library.WriteImageToSavedPhotosAlbumAsync  \t\t\t\t\t\t\t\t\t\t\t(DownloadedImageView.Image.CGImage, dict); \t\tResultTextView.Text += &quot;Saved to album assetUrl = &quot; + assetUrl + &quot;\\n&quot;;  \t\tResultTextView.Text += &quot;\\n\\n\\n&quot; + contents; \/\/ just dump the entire HTML \t\treturn length;  \t} catch { \t\t\/\/ do something with error \t\treturn -1; \t} }<\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0432\u043d\u0438\u043b\u0438? \u041d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043b\u0438\u043d\u0435\u0435\u043d, \u043f\u0440\u043e\u0441\u0442 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. <\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c HttpClient, \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 API \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0432 Xamarin. \u0412 \u043a\u043e\u0434\u0435 \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u043a\u0430\u0447\u0430\u0442\u044c html \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b xamarin.com \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 GetStringAsync, \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442 html \u0441 \u0441\u0430\u0439\u0442\u0430. \u0418 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c Task, \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c await, \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0431\u0435\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041a\u043e\u0433\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0430, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 await, \u043c\u044b \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0435\u0435 \u0434\u043b\u0438\u043d\u0443 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c httpClient.GetByteArrayAsync, \u043c\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e Task, \u0430 \u0441\u0440\u0430\u0437\u0443 \u0436\u0434\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  \u041a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043d \u0438 \u043f\u043e\u043d\u044f\u0442\u0435\u043d.<\/p>\n<p>  \u042f \u043d\u0435 \u0434\u0435\u043b\u0430\u043b \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u044d\u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u0435\u0432\u0430\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043b\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 HttpClient \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0435\u0435 \u0432 \u0431\u043b\u043e\u043a\u0435 catch. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0443 \u0437\u0430 \u043d\u0430\u0441.<\/p>\n<p>  \u042f \u043f\u043e\u043c\u0435\u0442\u0438\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0446\u0432\u0435\u0442\u0430\u043c\u0438, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u0438 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u0438:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/10d\/655\/c5a\/10d655c5ad6853831d05e3f4700b0077.jpg\"\/><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u043d\u0435\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043d \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043e\u0434, \u043a\u0430\u043a \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u0440\u0430\u0437\u043c\u0430\u0437\u0430\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443. \u0412\u0435\u0440\u0441\u0438\u044f \u0441 async\/await \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<h4>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 async\/await<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435? \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 async \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043b\u044f\u043c\u0431\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u043d\u0438\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u0441\u0443\u0444\u0444\u0438\u043a\u0441 Async \u0432 \u0438\u043c\u0435\u043d\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c \u0438\u0445 \u043e\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/b04\/eb9\/1f5\/b04eb91f56b964b5fc06cfe654752317.jpg\"\/><\/p>\n<p>  Async \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c void, Task \u0438\u043b\u0438 Task. Void \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Task, \u0438\u043d\u0430\u0447\u0435 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e Task. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Task \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0438\u0437 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<p>  Await \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u043a\u0430\u043a async. Await \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Catch \u0438 Finally \u0431\u043b\u043e\u043a\u0430\u0445.<\/p>\n<h4>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0437\u0432\u0430\u043b\u0438 await \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438, \u043b\u044e\u0431\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u0432 \u043c\u0435\u0442\u043e\u0434 \u0436\u0434\u0443\u0449\u0438\u0439 \u0437\u0430\u0434\u0430\u0447\u0443. <\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u043c void \u043d\u0435\u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043a \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e\u043c\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/i><\/p>\n<pre><code class=\"cs\">try {     \/\/\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u0434\u0448\u0438\u0435 \u0432 t \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u043d\u0430\u0432\u0435\u0440\u0445     await t;     ResultTextView.Text += &quot;** Downloaded &quot; + t.Result.Length + &quot; bytes\\n&quot;; } catch(OperationCancelledException) {\/\/\u0435\u0441\u043b\u0438 t \u0431\u044b\u043b \u043e\u0442\u043c\u0435\u043d\u0435\u043d} catch(Exception exc) {     \/\/\u043f\u043e\u0439\u043c\u0430\u0435\u0442 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 t     ResultTextView.Text += &quot;--Download Error: &quot; + exc.Messsage + &quot;\\n&quot;; }<\/code><\/pre>\n<h4>\u041e\u0442\u043c\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447<\/h4>\n<p>  \u0410\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u043e\u043b\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0441\u0435\u0442\u044c\u044e. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0438\u0437 \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>  \u041e\u0442\u043c\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 Cancellation token. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u0437\u0430\u0434\u0430\u0447.<\/p>\n<pre><code class=\"cs\">var cts = new CancellationTokenSource(); var intResult = await DownloadHomepageAsync(cts.Token); \/\/\u043f\u043e\u0437\u0436\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 cts.Cancel();<\/code><\/pre>\n<h4>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430<\/h4>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0435\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u0439\u0442. <br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439 IProgress. <\/p>\n<pre><code class=\"cs\">public class Progress&lt;T&gt; : IProgress&lt;T&gt; {     public Progress;     public Progress(Action&lt;T&gt; handler);     protected virtual void OnReport(T value);     public event EventHandler&lt;T&gt; ProgressChanged; \/\/\u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 } <\/code><\/pre>\n<h4>\u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u0447<\/h4>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0447 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.threading.tasks.task.whenany.aspx\">Task.WhenAny<\/a> \u0438 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.threading.tasks.task.whenall.aspx\">Task.WhenAll<\/a>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u0434\u043d\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0438\u043b\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code class=\"cs\">while(tasks.Count &gt; 0) {     \/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u043b\u044e\u0431\u0430\u044f \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430     \/\/t \u2014\u00a0\u043f\u0435\u0440\u0432\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430     var t = await Task.WhenAny(tasks);     tasks.Remove(t);     try {         await t; \/\/\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f t \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f         ResultTextView.Text += &quot;++ Downloaded &quot; + t.Result.length + &quot; bytes\\n&quot;;     }    catch(OperationCancelledException) {}    catch(Exception exc) {         \/\/\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0432\u0448\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f t         ResultTextView.text += &quot;-- Download Error: &quot; + exc.Message + &quot;\\n&quot;;    } }<\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0442\u0440\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u0441\u0430\u0439\u0442\u0430, \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 403 \u043e\u0448\u0438\u0431\u043a\u0443. \u0418\u0442\u0430\u043a, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a tasks \u0438 \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u043e\u043a\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435 \u043e\u043f\u0443\u0441\u0442\u0435\u0435\u0442. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0447\u0435\u0440\u0435\u0437 Task.WhenAny \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0435\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f, \u043e\u043d\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u043b\u044e\u0431\u0430\u044f \u0438\u0437 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0438 \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043c \u0435\u0435 \u0432 t. \u0423\u0434\u0430\u043b\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c wait t, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u0434\u0430\u0447\u0438. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0432\u0448\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f t \u0432\u0441\u043f\u043b\u044b\u0432\u0443\u0442 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 await. \u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435\u0441\u044c \u043a \u043d\u0435\u043c\u0443.<\/p>\n<p>  <b>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e C# async \u0432 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/hh191443.aspx\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Microsoft<\/a>, \u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 API iOS \u0438 Android \u043d\u0430 <a href=\"http:\/\/docs.xamarin.com\/guides\/cross-platform\/advanced\/async_support_overview\">\u0441\u0430\u0439\u0442\u0435 Xamarin<\/a>. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 <a href=\"https:\/\/github.com\/xamarin\/mobile-samples\/tree\/master\/AsyncAwait\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043a \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0443<\/a>.<\/b><\/p>\n<hr\/>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043d\u0430\u0448 \u0445\u0430\u0431\u0440\u0430-\u0431\u043b\u043e\u0433 (\u043a\u043d\u043e\u043f\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u0432\u0432\u0435\u0440\u0445\u0443). \u041a\u0430\u0436\u0434\u044b\u0439 \u0447\u0435\u0442\u0432\u0435\u0440\u0433 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u0435 \u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0443\u0434\u0438\u0438. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f (12 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f) \u00ab\u041a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0443\u0434\u0438\u0438\u00bb: \u0438\u0441\u043f\u043e\u0432\u0435\u0434\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u043d\u0438\u043a\u0430 \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445, \u043e\u0442\u0447\u0435\u0442\u0430\u0445, \u043c\u0435\u0433\u0430\u043f\u043b\u0430\u043d\u0435, \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0439 CRM \u0438 \u043f\u0443\u0442\u0438 \u0435\u0433\u043e \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u043e\u0441\u0442\u0430.   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/touchinstinct\/blog\/191926\/\"> http:\/\/habrahabr.ru\/company\/touchinstinct\/blog\/191926\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       Xamarin \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/hh191443.aspx\">C# 5 Async\/await<\/a> \u043d\u0430 iOS \u0438 Android. \u041a\u0440\u043e\u043c\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 .NET Async, \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c 174 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 Xamarin.iOS \u0438 337 \u0432 Xamarin.Android. \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u0442\u0430\u043a \u0436\u0435 \u0441\u0442\u0430\u043b <a href=\"http:\/\/xamarin.com\/mobileapi\">Xamarin Mobile<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u0435, \u043a\u0430\u043c\u0435\u0440\u0435 \u0438 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438. <a href=\"http:\/\/components.xamarin.com\/\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/a> \u0432\u043e\u0432\u0441\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 async, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 backend <a href=\"http:\/\/components.xamarin.com\/view\/parse\/\">Parse<\/a>.<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 <a href=\"http:\/\/blog.xamarin.com\/csharp-async-on-ios-and-android\/\">\u0432\u0435\u0431\u0438\u043d\u0430\u0440\u0430<\/a> \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/dd8\/827\/942\/dd88279421732391b81adff42c27eb77.png\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-191926","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/191926","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=191926"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/191926\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}