static bool IsDataSerializable (object obj) { if (obj is ISerializable) return true; AttributeCollection attrs = TypeDescriptor.GetAttributes (obj); return attrs [typeof (SerializableAttribute)] != null; }