{"id":541,"date":"2006-01-30T09:00:00","date_gmt":"2006-01-30T00:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2006-01-30-9.html"},"modified":"2006-01-30T09:00:00","modified_gmt":"2006-01-30T00:00:00","slug":"2006-01-30-9","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2006-01-30-9.html","title":{"rendered":"C#.NET \u3068 MVC(PAC)"},"content":{"rendered":"<p>\n&#8211; <a href=\"http:\/\/www.atmarkit.co.jp\/bbs\/phpBB\/viewtopic.php?topic=27306&amp;forum=7\">\u4ef6\u540d\uff1aPAC\u30d1\u30bf\u30fc\u30f3\u306b\u304a\u3044\u3066\u3001Form\u30af\u30e9\u30b9\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u5c64\u306a\u306e\u304b\uff1f<\/a><br \/>\n\u81ea\u52d5\u751f\u6210\u306e Form \u3060\u3068\u3001MVC \u306e V+C \u306a\u52d5\u4f5c\u3092\u3057\u3066\u3044\u307e\u3059\u306d\u3002<br \/>\n\u7d50\u8ad6\u3068\u3057\u3066\u306f\u3001\u3053\u3053\u306e\u6d41\u308c\u3069\u304a\u308a\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u5225\u306b\u4f5c\u3063\u3066\u3001\u305d\u3063\u3061\u3092\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\u306b\u3059\u308b\u306e\u304c\u30d9\u30bf\u30fc\u3058\u3083\u306a\u3044\u304b\u306a\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n&nbsp;<br \/>\n2006-02-08 \u8ffd\u8a18:<br \/>\n\u3088\u304f\u4f7f\u308f\u308c\u308b Application.Run(Form) \u3060\u3068\u3001\u305b\u3063\u304b\u304f Main() \u30e1\u30bd\u30c3\u30c9\u3092\u5206\u96e2\u3057\u3066\u3082\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306e\u6bb5\u968e\u3067 V+C \u306a\u5f62\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001ApplicationContext \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3053\u308c\u3092 Application.Run(ApplicationContext) \u306b\u6e21\u3057\u3066\u3084\u308b\u3068\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3068\u30d3\u30e5\u30fc\u306e\u5206\u96e2\u304c\u3088\u308a\u30b9\u30de\u30fc\u30c8\u306b\u3067\u304d\u308b\u3002<br \/>\n&nbsp;<br \/>\n2007-04-10 \u8ffd\u8a18:<br \/>\nApplicationContext \u3092\u5229\u7528\u3057\u305f\u5834\u5408\u306e\u5b9f\u88c5\u4f8b\u306f\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002\n<\/p>\n<blockquote><p>using System;<br \/>\nusing System.Windows.Forms;<br \/>\n&nbsp;<br \/>\nclass Controller : ApplicationContext{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ MVC \u306e view \u30ec\u30a4\u30e4( Controller \u3068\u306e\u63a5\u5408\u90e8\u306e\u307f\u3092 IView \u3068\u3057\u3066 interface \u306b\u3057\u3066\u3082\u3088\u3044)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;private Form1 view;<br \/>\n&nbsp;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ \u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;internal Controller(){<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;view = new Form1();<\/p>\n<p>\t\/\/ \u30d5\u30a9\u30fc\u30e0\u304c\u9589\u3058\u3089\u308c\u305f\u6642\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u7d42\u4e86\u3055\u305b\u308b\u305f\u3081\u306e\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3092\u8ffd\u52a0\u3002<br \/>\n\tview.Dispose += new EventHandler( delegate (object sender, EventArgs e){<br \/>\n\t        Dispose();<br \/>\n\t\tApplication.Exit();<br \/>\n\t    });<br \/>\n\t\/\/ \u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a<br \/>\n\tview.Show();<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;}<br \/>\n}\n<\/p><\/blockquote>\n<p>\u3042\u3068\u306f\u3053\u308c\u3092 Program.cs \u306a\u3069\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8( static void Main(string[]) \u95a2\u6570)\u306e\n<\/p>\n<blockquote><p>Application.Run(new Form1);\n<\/p><\/blockquote>\n<p>\u306a\u3069\u3068\u306a\u3063\u3066\u3044\u308b\u7b87\u6240\u3092\n<\/p>\n<blockquote><p>Application.Run(new Controller());\n<\/p><\/blockquote>\n<p>\u306e\u3088\u3046\u306b\u3059\u308c\u3070\u3001\u76f4\u63a5 Form \u3092\u547c\u3073\u51fa\u3059\u5b9f\u88c5\u3067\u306f\u306a\u304f ApplicationContext \u3092\u4ecb\u3057\u305f\u5b9f\u88c5\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n&nbsp;<br \/>\n\u53c2\u8003:<br \/>\n&#8211; <a href=\"http:\/\/www.atmarkit.co.jp\/fdotnet\/dotnettips\/031vbstartup\/vbstartup.html\">.NET TIPS &#8211; VB.NET\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u3055\u308c\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\uff1f<\/a>(@IT)<br \/>\nVS.NET \u3067\u306e\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\u306e\u8a2d\u5b9a\u306e\u4ed5\u65b9\u306b\u3064\u3044\u3066\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n&#8211; <a href=\"http:\/\/www.microsoft.com\/japan\/msdn\/library\/default.asp?url=\/japan\/msdn\/library\/ja\/cpref\/html\/frlrfsystemwindowsformsapplicationclassruntopic2.asp\">Application.Run\u30e1\u30bd\u30c3\u30c9(ApplicationContext)<\/a> (MSDN -> .NET Framework-> \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 -> \u30af\u30e9\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea -> System.Windows.Forms -> Application \u30af\u30e9\u30b9 -> \u30e1\u30bd\u30c3\u30c9 -> Run \u30e1\u30bd\u30c3\u30c9)<br \/>\n\u30ea\u30f3\u30af\u5148\u306e\u30b5\u30f3\u30d7\u30eb\u306e\u52d5\u4f5c\u306b\u306f\u6b21\u306e\u5ba3\u8a00\u304c\u5fc5\u8981\u3002\u307e\u305f\u3001MyForm1, MyForm2 \u3068\u3044\u3046\u30d5\u30a9\u30fc\u30e0\u30af\u30e9\u30b9\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\n<\/p>\n<blockquote><p>using System;<br \/>\nusing System.Windows.Forms;<br \/>\nusing System.Drawing;<br \/>\nusing System.IO;<br \/>\nusing System.ComponentModel;<br \/>\nusing System.Text; \n<\/p><\/blockquote>\n<p>\n","protected":false},"excerpt":{"rendered":"<p>&#8211; \u4ef6\u540d\uff1aPAC\u30d1\u30bf\u30fc\u30f3\u306b\u304a\u3044\u3066\u3001Form\u30af\u30e9\u30b9\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u5c64\u306a\u306e\u304b\uff1f \u81ea\u52d5\u751f\u6210\u306e Form \u3060\u3068\u3001MVC \u306e V+C \u306a\u52d5\u4f5c\u3092\u3057\u3066\u3044\u307e\u3059\u306d\u3002 \u7d50\u8ad6\u3068\u3057\u3066\u306f\u3001\u3053\u3053\u306e\u6d41\u308c\u3069\u304a\u308a\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u5225\u306b\u4f5c\u3063\u3066\u3001\u305d\u3063 &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2006-01-30-9.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">C#.NET \u3068 MVC(PAC)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[72],"class_list":["post-541","post","type-post","status-publish","format-standard","hentry","tag-c23"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":0,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/541\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}