{"id":8350,"date":"2018-12-06T12:12:02","date_gmt":"2018-12-06T03:12:02","guid":{"rendered":"https:\/\/www.gesource.jp\/weblog\/?p=8350"},"modified":"2018-11-09T22:14:40","modified_gmt":"2018-11-09T13:14:40","slug":"xamarin-mac%e3%81%a7%e3%80%81%e3%82%a2%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e5%a4%9a%e9%87%8d%e8%b5%b7%e5%8b%95%e3%82%92%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%81%99","status":"publish","type":"post","link":"https:\/\/www.gesource.jp\/weblog\/?p=8350","title":{"rendered":"Xamarin.Mac\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u591a\u91cd\u8d77\u52d5\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306b\u306f"},"content":{"rendered":"<p>NSRunningApplication\u30af\u30e9\u30b9\u306eGetRunningApplications()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u8d77\u52d5\u3057\u3066\u3044\u308b\u6307\u5b9a\u3057\u305f\u30d0\u30f3\u30c9\u30ebID\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u914d\u5217(NSRunningApplication[])\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre><code>public override void DidFinishLaunching(NSNotification notification)\n{\n    var apps = NSRunningApplication.GetRunningApplications(NSBundle.MainBundle.BundleIdentifier);\n    if (apps.Length &gt; 1)\n    {\n        Console.WriteLine($\"\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3059\u3067\u306b\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059\u3002\");\n        NSApplication.SharedApplication.Terminate(this);\n    }\n}\n<\/code><\/pre>\n<h3>\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0<\/h3>\n<p>Github\u304b\u3089\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/gesource\/Xamarin.Mac-Sample\/tree\/master\/CheckDeduplicateRunningSample\">\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0<\/a><\/li>\n<\/ul>\n<p>\u3059\u3067\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\u3068\u304d\u306f\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NSRunningApplication\u30af\u30e9\u30b9\u306eGetRunningApplications()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u8d77\u52d5\u3057\u3066\u3044\u308b\u6307\u5b9a\u3057\u305f\u30d0\u30f3\u30c9\u30ebID\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u914d\u5217(NSRunningApplication[])\u3092\u8fd4\u3057\u307e &#8230;<\/p>\n<p><a href=\"https:\/\/www.gesource.jp\/weblog\/?p=8350\" class=\"more-link\">Continue reading &lsquo;Xamarin.Mac\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u591a\u91cd\u8d77\u52d5\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306b\u306f&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[175],"tags":[137,176],"class_list":["post-8350","post","type-post","status-publish","format-standard","hentry","category-c","tag-mac","tag-xamarin"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/8350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8350"}],"version-history":[{"count":0,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/8350\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}