I found this on MSDN - using google - that free search engine - accessible by everyone - everywhere:
public static int GetSizeOfObject(object obj)
{
object Value = null;
int size = 0;
Type type = obj.GetType();
PropertyInfo[] info = type.GetProperties();
foreach(PropertyInfo property in info)
{
Value = property.GetValue(obj,null);
unsafe
{
size += sizeof(Value);
}
}
return size;
}