Persist code for a Collection (for my custom component)

D

Derrick

Hello all;

I have created a custom component, whose properties (let's call them
myObjectA and an collection of myObjectB) I'm trying to set via a GUI. I
have the GUI running after the user clicks a Designer Verb, and it gets the
values for myObjectA and myObjectB correctly.

The designer creates the code for myObjectA just fine, however I can't seem
to get it to work for the Collection of myObjectB's. At first I had an
arraylist of myObjectB's, then I tried creating a strongly-typed
myObjectBCollection class (extending CollectionBase), and still nothing. If
I create a singleton instance of myObjectB and fill the values for that, the
code will be generated properly, so I'm confident that the problem lies with
my handling (or lack thereof) of the collection.

What am I missing to get the designer to persist the code for the Collection
object??

Thanks for any and all help!

Derrick
 
E

Eric Cadwell

Have you marked the collection property with the
DesignerSerializationVisibility attribute?

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public myObjectBCollection Bs
{
get { return objectBs; }
}

HTH;
Eric Cadwell
http://www.origincontrols.com
 

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