{"id":347,"date":"2017-03-06T12:53:56","date_gmt":"2017-03-06T03:53:56","guid":{"rendered":"http:\/\/marius.main.jp\/software\/blog\/?p=347"},"modified":"2020-03-25T18:24:59","modified_gmt":"2020-03-25T09:24:59","slug":"post-347","status":"publish","type":"post","link":"https:\/\/todosoft.net\/blog\/?p=347","title":{"rendered":"Enum\u578b\u3092\u30eb\u30fc\u30d7\u3067\u56de\u3059"},"content":{"rendered":"\n<p> Enum\u578b\u3092\u30eb\u30fc\u30d7\u3067\u56de\u3059\u306b\u306f\u3001Enum.GetNames \u3082\u3057\u304f\u306f Enum.GetValues \u3092\u7528\u3044\u308b\u3002<br>\u307e\u305f\u3001\u6570\u5024\u2192Enum\u578b\u306fEnum\u578b\u306b\u30ad\u30e3\u30b9\u30c8\u3092\u3001<br>Enum\u578b\u2192\u6570\u5024\u306fInt\u578b\u306b\u30ad\u30e3\u30b9\u30c8\u3092\u3001<br>Enum\u578b\u2192\u540d\u524d\u306fToString\u3092\u7528\u3044\u308b\u3002 <\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">private enum enmColor\n{\n    Red = 1,\n    Green = 2,\n    Blue = 3\n}\n\nprivate void button1_Click(object sender, EventArgs e)\n{\n    string strResult = \"\";\n\n    foreach (int intNum in Enum.GetValues(typeof(enmColor)))\n    {\n        enmColor objColor = (enmColor)intNum;\n        strResult += string.Format(\"{0}:{1}\", ((int)objColor).ToString(), objColor.ToString());\n    }\n\n    MessageBox.Show(strResult);\n    \/*\n        1:Red\n        2:Green\n        3:Blue\n     *\/\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Enum\u578b\u3092\u30eb\u30fc\u30d7\u3067\u56de\u3059\u306b\u306f\u3001Enum.GetNames \u3082\u3057\u304f\u306f Enum.GetValues \u3092\u7528\u3044\u308b\u3002\u307e\u305f\u3001\u6570\u5024\u2192Enum\u578b\u306fEnum\u578b\u306b\u30ad\u30e3\u30b9\u30c8\u3092\u3001Enum\u578b\u2192\u6570\u5024\u306fInt\u578b\u306b\u30ad\u30e3\u30b9\u30c8\u3092\u3001Enum\u578b\u2192\u540d\u524d\u306fToS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,15],"tags":[],"class_list":["post-347","post","type-post","status-publish","format-standard","hentry","category-c","category-15"],"_links":{"self":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=347"}],"version-history":[{"count":2,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":733,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/347\/revisions\/733"}],"wp:attachment":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}