C
colin
Hi,
Im a bit confused about when you cast a value type to an object.
I have a property grid wich stores the data and the defualt as
objects.
the data is limited to primitive types, structs and strings.
the structs only have primitive types.
however once ive set the data to the defualt,
if the data is a struct then any edits change the defualt data as well
wich was unexpected !
however it doesnt happen for primitive types.
I thought value types were always passed by value,
does this mean an object is actually able to behave
as a pointer to a struct ?
I gues il have to identify if its a struct and copy it with reflection ?...
but why is there not even Type.IsStruct ?
would this be the same as !IsClass&&!IsInterface&&!IsPrimitive ?
Colin =^.^=
Im a bit confused about when you cast a value type to an object.
I have a property grid wich stores the data and the defualt as
objects.
the data is limited to primitive types, structs and strings.
the structs only have primitive types.
however once ive set the data to the defualt,
if the data is a struct then any edits change the defualt data as well
wich was unexpected !
however it doesnt happen for primitive types.
I thought value types were always passed by value,
does this mean an object is actually able to behave
as a pointer to a struct ?
I gues il have to identify if its a struct and copy it with reflection ?...
but why is there not even Type.IsStruct ?
would this be the same as !IsClass&&!IsInterface&&!IsPrimitive ?
Colin =^.^=