What format do you want the data? Would binary/xml serialization be an
option? To mirror the way that PropertyGrid presents properties, you
would need to ask the TypeConverter for the properties (normally
TypeDescriptor. GetProperties is used, but not with PropertyGrid... ):
foreach (PropertyDescri ptor prop in
TypeDescriptor. GetConverter(ob j).GetPropertie s(obj))
{
object val = prop.GetValue(o bj);
string s = prop.Converter. ConvertToString (val);
// do something with s
}
(actually, to be thorough you would need to implement an
ITypeDescriptor Context, but that might be overkill)
Since you are making use of controls that require a message pump (eg Form),
I think you need to decorate the Main method with the [STA] attribute.. But
then again, I may be full of it.
mmmmm. actually, since you are not using Application.Run () then there is no
message pump anyway right?.. never mind then... oooooops :)
"Rene" <a@b.comwrote in message
news:%23knL4hJr IHA.2520@TK2MSF TNGP02.phx.gbl. ..
Hi Mark,
>
Since you are making use of controls that require a message pump (eg
Form), I think you need to decorate the Main method with the [STA]
attribute.. But then again, I may be full of it.
>
>
>
[STA]
>
static void Main()
>
>
mmmmm. actually, since you are not using Application.Run () then there is no
message pump anyway right?.. never mind then... oooooops :)
Exactly - Form was just chosen as something with more than a couple of
properties, that would be instantly recognisable... it isn't actually
used, so no STA required ;-p
Comment