static void GetPropertyInformation(IList<PropertyValue> infoList, object obj, string propertyName, int depth)
{
ICollection ar = obj as ICollection;
if (ar != null)
{
int i = 0;
foreach (object o1 in ar)
{
if (o1 != null)
{
GetPropertyInformation(infoList, o1, propertyName + "." + i.ToString(CultureInfo.InvariantCulture), depth);
}
i++;
}
}
else
{
foreach (PropertyInfo pi in obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
if (pi.PropertyType == typeof(IPackage) || pi.PropertyType.IsSubclassOf(typeof(VariablePackage)))
{
object o2 = pi.GetValue(obj, null);
if (o2 != null)
{
GetPropertyInformation(infoList, o2, propertyName + "." + pi.Name, depth + 1);
}
}
else
{
object objx = pi.GetValue(obj, null);
if (objx != null)
{
ICollection arx = objx as ICollection;
if (arx != null)
{
GetPropertyInformation(infoList, objx, propertyName + "." + pi.Name, depth);
}
else
{
string propType = pi.PropertyType.ToString();
if (pi.PropertyType.IsEnum)
{
propType += "(" + pi.PropertyType.GetEnumUnderlyingType().ToString() + ")";
}
PropertyValue pv = new PropertyValue("".PadLeft(depth, '-') + propertyName + "." + pi.Name, objx.ToString(), propType, GetHexValue(objx));
if (!string.IsNullOrEmpty(pv.HexValue))
{
infoList.Add(pv);
}
}
}
}
}
}
}
static string GetHexValue(object obj)