OmarElabd / ObjectExporter

Object Exporter lets you export out an object while debugging in Visual Studio, the object can be serialized in either C#, JSON or XML.
GNU General Public License v3.0
264 stars 82 forks source link

Do not set values for private fields #4

Closed OmarElabd closed 9 years ago

OmarElabd commented 9 years ago

Seems like there is no way to detect whether the expression is private or not. I could introduce an option to exclude expression preceded with an underscore from the generated code.

OmarElabd commented 9 years ago

I may be able to examine the class to see if it has a public property or field. Note: even though property maybe public, check to make sure there isn't a private set;

OmarElabd commented 9 years ago

Resolved by getting Type of object, and reflecting public fields and properties, maintain a dictionary of types, list of properties check each property. It would improve performance to check prepended underscores but that does not guarantee it is a private field as that is only a convention.