public ExpressionTreeNode(Object value)
{
Type type = value.GetType();
Text = type.ObtainOriginalName();
if (value is Expression) {
ImageIndex = 2;
SelectedImageIndex = 2;
PropertyInfo[] propertyInfos = null;
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Expression<>)) {
propertyInfos = type.BaseType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
}
else {
propertyInfos = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
}
foreach (PropertyInfo propertyInfo in propertyInfos) {
if ((propertyInfo.Name != "nodeType")) {
Nodes.Add(new AttributeNode(value, propertyInfo));
}
}
}
else {
ImageIndex = 4;
SelectedImageIndex = 4;
Text = "\"" + value.ToString() + "\"";
}
}