How to serialize a custom collection in a custom control

S

Sven Kr?ger

I´ve developed a custom control with a property of a custom collection
type.

The custom collection hosts instances of a Custom type.
The type is marked as Serializable via the Serializable() Attribute.

Within the standard .NET Framework everything works fine.
Within in the Compact Framework i got an error when i try to compile
the application, that uses my control:

Form1.resx Resource transformation for file 'Form1.resx' failed.
Type CFControls.LimitItem cannot be compiled into the .resources
file.
This type is not supported for .NET Compact Frameworks.

OK, the Resource Compiler (CFResGen.exe) seems to have problems with
custom types. But why? Do i have to tell him how to do it? And if,
how?

So, does anyone know how to solve this problem?
Maybe there is a way to tell the Visual Studio IDE respectivly the
Form designer, to serialize my custom collection without using
resources.

many thanks in advance...

Sven
 
S

Sven Kr?ger

You're right! That was exactly my problem.
Your tip was very useful. Now everything works like expected.

I've integrated a TypeConverter for the custom type and now source
code is generated for serializing the collection. And that works also
within the CF because binary resource serialization is no longer
needed.

Thank you very much!!!!

Sven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top