{"id":528,"date":"2006-01-13T01:00:00","date_gmt":"2006-01-12T16:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2006-01-13-1.html"},"modified":"2006-01-13T01:00:00","modified_gmt":"2006-01-12T16:00:00","slug":"2006-01-13-1","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2006-01-13-1.html","title":{"rendered":"\u81ea\u52d5\u7684\u306b\u30ea\u30bd\u30fc\u30b9\u3092\u958b\u653e\u3059\u308b\u69cb\u6587"},"content":{"rendered":"<p>\nSystem.IDisposable \u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u3068\u3001using(obj){ \/* &#8230; *\/ }\u3068\u3044\u3046\u69cb\u6587\u304c\u4f7f\u3048\u308b\u3002\u305f\u3068\u3048\u3070\n<\/p>\n<blockquote><p>Graphics g;<br \/>\nBrush b;<br \/>\ntry{<br \/>\n\tg = pictureBox1.CreateGraphics();<br \/>\n\tb = new SolidBrush(Color.Black);<br \/>\n\tg.FillRectangle(b, 10, 0, 100, 100);<br \/>\n}finally{<br \/>\n\tb.Dispose();<br \/>\n\tg.Dispose();<br \/>\n}\n<\/p><\/blockquote>\n<p>\u306f,\n<\/p>\n<blockquote><p>using(Graphics g = pictureBox1.CreateGraphics()){<br \/>\n\tusing(Brush b = new SolidBrush(Color.Black)){<br \/>\n\t\tg.FillRectangle(b, 10, 0, 100, 100);<br \/>\n\t}<br \/>\n}\n<\/p><\/blockquote>\n<p>\u3068\u7b49\u3057\u3044\u3002<br \/>\n\u6a19\u6e96\u30af\u30e9\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u591a\u304f\u306e\u30af\u30e9\u30b9\u304c\u3053\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30d5\u30a1\u30a4\u30eb\u30a2\u30af\u30bb\u30b9\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a2\u30af\u30bb\u30b9\u306a\u3069\u3067\u3082\u5229\u7528\u3067\u304d\u3066\u306a\u304b\u306a\u304b\u4fbf\u5229\u3002<br \/>\n\u53c2\u8003:<br \/>\n&#8211; <a href=\"http:\/\/www.divakk.co.jp\/aoyagi\/csharp_tips_using.html\">C# Tips \u2212using\u3092\u4f7f\u3048\u3001\u4f7f\u3048\u3063\u305f\u3089\u4f7f\u3048(^^)<\/a><br \/>\n&#8211; <a href=\"http:\/\/www.microsoft.com\/japan\/msdn\/library\/default.asp?url=\/japan\/msdn\/library\/ja\/cpref\/html\/frlrfsystemidisposableclasstopic.asp\">.NET Framework \u30af\u30e9\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea &#8211; IDisposable \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System.IDisposable \u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u3068\u3001using(obj){ \/* &#8230; *\/ }\u3068\u3044\u3046\u69cb\u6587\u304c\u4f7f\u3048\u308b\u3002\u305f\u3068\u3048\u3070 Graphics g; Brush b; try{ g = pictureBox &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2006-01-13-1.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u81ea\u52d5\u7684\u306b\u30ea\u30bd\u30fc\u30b9\u3092\u958b\u653e\u3059\u308b\u69cb\u6587<\/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-528","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\/528","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=528"}],"version-history":[{"count":0,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/528\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}