{"id":923,"date":"2017-02-10T01:32:33","date_gmt":"2017-02-09T16:32:33","guid":{"rendered":"http:\/\/okamurax.com\/?p=923"},"modified":"2020-05-05T01:03:30","modified_gmt":"2020-05-04T16:03:30","slug":"c-mediator","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=923","title":{"rendered":"C# Mediator"},"content":{"rendered":"<pre class=\"lang:c# decode:true  \">namespace ConsoleApplication2\r\n{\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n\r\n        }\r\n    }\r\n\r\n    \/* Mediator \r\n    \u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u554f\u5408\u305b\u3092\u53d7\u3051\u3001\u76f8\u4e92\u306e\u8abf\u6574\u3092\u3057\u3001\u6307\u793a\u3092\u51fa\u3059\u3002 *\/\r\n\r\n    public interface Mediator\r\n    {\r\n        bool Consult(Colleague c);\r\n    }\r\n    public interface Colleague\r\n    {\r\n        void Inquiry();\r\n    }\r\n\r\n    public class ConcreateMediator: Mediator\r\n    {\r\n        public bool Consult(Colleague c)\r\n        {\r\n            if (true) \/\/ \u3053\u3053\u3067\u554f\u5408\u305b\u306b\u5bfe\u3059\u308b\u6761\u4ef6\u5206\u5c90\r\n            {\r\n                return true;\r\n            }\r\n            else\r\n            {\r\n                return false;\r\n            }\r\n        }\r\n        \r\n    }\r\n\r\n    public class ConcreateColleague: Colleague\r\n    {\r\n        public void Inquiry()\r\n        {\r\n            Mediator m = new ConcreateMediator();\r\n\r\n            if (m.Consult(this))\r\n            {\r\n                \/\/\u554f\u5408\u305b\u7d50\u679c\r\n            }\r\n        }\r\n    }\r\n\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>namespace ConsoleApplication2 { class Program { static void Main(string[] args) { } } \/* Mediator \u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u554f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=923\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;C# Mediator&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9,144],"class_list":["post-923","post","type-post","status-publish","format-standard","hentry","category-1","tag-c-net","tag-144"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=923"}],"version-history":[{"count":1,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/923\/revisions"}],"predecessor-version":[{"id":924,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/923\/revisions\/924"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}