{"id":933,"date":"2017-02-13T04:34:40","date_gmt":"2017-02-12T19:34:40","guid":{"rendered":"http:\/\/okamurax.com\/?p=933"},"modified":"2020-05-05T01:03:13","modified_gmt":"2020-05-04T16:03:13","slug":"c-proxy","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=933","title":{"rendered":"C# Proxy"},"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            Subject subject = new Proxy();\r\n            subject.Request1();\r\n            subject.Request2();\r\n        }\r\n    }\r\n\r\n    \/* Proxy \u4ee3\u7406\u4eba *\/\r\n\r\n    interface Subject\/\/Proxy\u3068RealSubject\u5171\u901a\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\r\n    {\r\n        void Request1();\r\n        void Request2();\r\n    }\r\n\r\n    public class Proxy : Subject \/\/Client\u304b\u3089\u306e\u51e6\u7406\u3092\u5b9f\u884c\u3002\r\n    {\r\n        public void Request1()\r\n        {\r\n            System.Console.WriteLine(\"this is proxy1\");\r\n        }\r\n        public void Request2()\r\n        {\r\n            \/\/\u4ee3\u7406\u4eba\u306b\u51e6\u7406\u3092\u4efb\u305b\u308b\u3002\r\n            RealSubject realsubject = new RealSubject();\r\n            realsubject.Request2();\r\n        }\r\n    }\r\n    public class RealSubject : Subject \/\/Proxy\u3067\u51e6\u7406\u3067\u304d\u306a\u3044\u5834\u5408\u51e6\u7406\u3002\r\n    {\r\n        public void Request1()\r\n        {\r\n            System.Console.WriteLine(\"this is real proxy1\");\r\n        }\r\n        public void Request2()\r\n        {\r\n            System.Console.WriteLine(\"this is real proxy2\");\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>namespace ConsoleApplication2 { class Program { static void Main(string[] args) { Subject subject = new Proxy( &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=933\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;C# Proxy&#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-933","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\/933","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=933"}],"version-history":[{"count":1,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/933\/revisions"}],"predecessor-version":[{"id":934,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/933\/revisions\/934"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}