{"id":424,"date":"2019-03-26T15:14:52","date_gmt":"2019-03-26T06:14:52","guid":{"rendered":"http:\/\/marius.main.jp\/software\/blog\/?p=424"},"modified":"2020-03-25T18:04:29","modified_gmt":"2020-03-25T09:04:29","slug":"post-424","status":"publish","type":"post","link":"https:\/\/todosoft.net\/blog\/?p=424","title":{"rendered":"\u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u30e1\u30bd\u30c3\u30c9\u3092\u7528\u3044\u3066\u5f15\u6570\u30fb\u8fd4\u308a\u5024\u306e\u578b\u3092\u52d5\u7684\u306b"},"content":{"rendered":"\n<p>\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u30fb\u8fd4\u308a\u5024\u306b\u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001<br>\u578b\u304c\u7570\u306a\u308b\u51e6\u7406\u3092\u540c\u4e00\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30af\u30e9\u30b9<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">    public class clsIntStruct\n    {\n        public int Value1 { get; set; }\n        public int Value2 { get; set; }\n    }\n\n    public class clsDoubleStruct\n    {\n        public double Value3 { get; set; }\n        public double Value4 { get; set; }\n    }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"> \u51e6\u7406\u30af\u30e9\u30b9 <\/h2>\n\n\n\n<p>\u5f15\u6570\u306b\u6e21\u3055\u308c\u305f\u30af\u30e9\u30b9\u3092\u300110\u500b\u306e\u914d\u5217\u306b\u3057\u3066\u8fd4\u3057\u3066\u3044\u308b<br>\u305d\u306e\u969b\u3001\u6e21\u3055\u308c\u305f\u30af\u30e9\u30b9\u5185\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u52d5\u7684\u306b\u53d6\u5f97\u3001\u683c\u7d0d\u3057\u3066\u3044\u308b<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">    public class clsToArray\n    {\n        public static List&lt;T> StructToArray&lt;T>(T objStrust) where T:class, new()\n        {\n            List&lt;T> arrayResult = new List&lt;T>();\n\n            for(int intCount = 0; intCount &lt; 10; intCount++)\n            {\n                T objWork = new T();\n\n                foreach (PropertyInfo objInfo in objStrust.GetType().GetProperties())\n                {\n                    objInfo.SetValue(objWork, objInfo.GetValue(objStrust));\n                }\n\n                arrayResult.Add(objWork);\n            }\n\n            return arrayResult;\n        }\n    }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u547c\u3073\u51fa\u3057\u30b5\u30f3\u30d7\u30eb<\/h2>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">        public MainWindow()\n        {\n            InitializeComponent();\n\n            \/\/ Int\u578b\u306e\u30af\u30e9\u30b9\n            clsIntStruct objInt = new clsIntStruct();\n            objInt.Value1 = 3;\n            objInt.Value2 = 10;\n\n            List&lt;clsIntStruct> resultInt = clsToArray.StructToArray(objInt);\n\n            \/\/\u3000Double\u578b\u306e\u30af\u30e9\u30b9\n            clsDoubleStruct objDouble = new clsDoubleStruct();\n            objDouble.Value3 = 1.5;\n            objDouble.Value4 = 9.7;\n\n            List&lt;clsDoubleStruct> resultDouble = clsToArray.StructToArray(objDouble);\n\n        }<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u30fb\u8fd4\u308a\u5024\u306b\u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3001\u578b\u304c\u7570\u306a\u308b\u51e6\u7406\u3092\u540c\u4e00\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b \u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u30af\u30e9\u30b9 \u51e6\u7406\u30af\u30e9\u30b9 \u5f15\u6570\u306b\u6e21\u3055\u308c\u305f\u30af\u30e9\u30b9\u3092\u300110\u500b\u306e\u914d\u5217\u306b\u3057\u3066\u8fd4\u3057\u3066\u3044\u308b\u305d\u306e\u969b\u3001\u6e21\u3055\u308c\u305f\u30af\u30e9\u30b9\u5185\u306e\u30d7\u30ed\u30d1 [&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,20,15],"tags":[],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-c","category-wpf","category-15"],"_links":{"self":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/424","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=424"}],"version-history":[{"count":6,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":722,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions\/722"}],"wp:attachment":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}