document.write('<link rel="stylesheet" href="http://gist.github.com/stylesheets/gist/embed.css"/>')





document.write('<div id=\"gist-149401\" class=\"gist\">\n  \n  \n    \n            \n\n      <div class=\"gist-file\">\n        <div class=\"gist-data gist-syntax\">\n          \n          \n          \n            <div class=\"gist-highlight\"><pre><div class=\"line\" id=\"LC1\">#region dumpClassProperties<\/div><div class=\"line\" id=\"LC2\">/// &lt;summary&gt;<\/div><div class=\"line\" id=\"LC3\">/// Pass in a class object and this will return a string<\/div><div class=\"line\" id=\"LC4\">/// in &quot;name = value \\n&quot; format of all properties and corresponding<\/div><div class=\"line\" id=\"LC5\">/// property values<\/div><div class=\"line\" id=\"LC6\">/// <\/div><div class=\"line\" id=\"LC7\">/// Usage : <\/div><div class=\"line\" id=\"LC8\">/// <\/div><div class=\"line\" id=\"LC9\">/// MyClass mc = new MyClass();<\/div><div class=\"line\" id=\"LC10\">/// <\/div><div class=\"line\" id=\"LC11\">/// mc.property1 = &quot;number one&quot;;<\/div><div class=\"line\" id=\"LC12\">/// mc.property2 = &quot;second property&quot;;<\/div><div class=\"line\" id=\"LC13\">/// mc.three	 = 333;<\/div><div class=\"line\" id=\"LC14\">/// <\/div><div class=\"line\" id=\"LC15\">/// string dump = dumpClassProperties( mc );<\/div><div class=\"line\" id=\"LC16\">/// &lt;/summary&gt;<\/div><div class=\"line\" id=\"LC17\">/// &lt;param name=&quot;obj&quot;&gt;&lt;/param&gt;<\/div><div class=\"line\" id=\"LC18\">/// &lt;returns&gt;&lt;/returns&gt;<\/div><div class=\"line\" id=\"LC19\">public static string dumpClassProperties(Object obj)<\/div><div class=\"line\" id=\"LC20\">{<\/div><div class=\"line\" id=\"LC21\">	System.Text.StringBuilder sb = new StringBuilder();<\/div><div class=\"line\" id=\"LC22\">&nbsp;<\/div><div class=\"line\" id=\"LC23\">	foreach ( System.Reflection.FieldInfo fi in obj.GetType().GetFields())<\/div><div class=\"line\" id=\"LC24\">	{<\/div><div class=\"line\" id=\"LC25\">		sb.Append(fi.Name + &quot; = &quot; + fi.GetValue(obj) + &quot;\\n&quot;);<\/div><div class=\"line\" id=\"LC26\">	}<\/div><div class=\"line\" id=\"LC27\">&nbsp;<\/div><div class=\"line\" id=\"LC28\">	return sb.ToString();<\/div><div class=\"line\" id=\"LC29\">} <\/div><div class=\"line\" id=\"LC30\">#endregion<\/div><\/pre><\/div>\n        \n        <\/div>\n\n        <div class=\"gist-meta\">\n          <a href=\"http://gist.github.com/raw/149401/da730952dcb8d19e85942fb4ff565c9a2b5ff777/Dump%20properties%20and%20values%20of%20a%20custom%20class\" style=\"float:right;\">view raw<\/a>\n          <a href=\"http://gist.github.com/149401#file_dump properties and values of a custom class\" style=\"float:right;margin-right:10px;color:#666\">Dump properties and values of a custom class<\/a>\n          <a href=\"http://gist.github.com/149401\">This Gist<\/a> brought to you by <a href=\"http://github.com\">GitHub<\/a>.\n        <\/div>\n      <\/div>\n    \n  \n<\/div>\n')
