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
263 stars 83 forks source link

Issues when exporting a collection of objects (typeof object) with different types #12

Closed OmarElabd closed 9 years ago

OmarElabd commented 9 years ago

Given some collection of type object, the collection members may be a different type other than object. However the code generated is not accurate.

Example:

items = new object[]
{
    new object {Some.Type}
    {
    }
}

when it should be:

items = new object[]
{
    new Some.Type
    {
    }
}

*Note: There are some special considerations for exporting value types within an object collection

 object[] obj = new object[]
            {
                new Form(),
                "Hello",
                2,
                DateTime.Now,
                22.24f,
                1.0m
            };
OmarElabd commented 9 years ago

Validate locals vs custom expressions

OmarElabd commented 9 years ago

fixed