By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,337 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,337 IT Pros & Developers. It's quick & easy.

Collection property

P: n/a
I want to implement a collection property inside another (in a control
derived class) but I have some persistence problems.

There is an example of my ColumnItem class

<TypeConverter(GetType(ColumnItemConverter))> _

Public Class ColumnItem

Private m_strText As String

Private m_intWidth As Integer

Private m_imgImage As Image

Private m_colValueItems As ValueItemsCollection

Public Sub New()

'...

End Sub

Public Property Text() As String

Get

Return m_strText

End Get

Set(ByVal Value As String)

m_strText = Value

End Set

End Property

Public Property Width() As Integer

Get

Return m_intWidth

End Get

Set(ByVal Value As Integer)

m_intWidth = Value

End Set

End Property

<Editor(GetType(CollectionEditor), GetType(UITypeEditor)), _

DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)> _

Public ReadOnly Property ValueItems() As ValueItemsCollection

Get

Return m_colValueItems

End Get

End Property

'... other properties

End Class
I have a CollectionBase derived class object that contains all my
columnitems.
ValueItemsCollection is another CollectionBase derived class for my
sub-collection.
When I enter new columns in design time, nothing is serialized in the
InitializeComponent of the form.

Does anybody could send me some tips about how to do that?

Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You probably need to add InstanceDescriptors for your collection contents.
Read this and it should get you pointed in the right direction:
http://www.msdn.microsoft.com/librar.../en-us/dndotne
t/html/custcodegen.asp?frame=true

--

Please do not reply to this alias directly. This posting is provided "AS
IS" with no warranties, and confers no rights. You assume all risk for your
use. 2002 Microsoft Corporation. All rights reserved.
"Marc L'Ecuyer" <ml******@chca.ca> wrote in message
news:Ob**************@TK2MSFTNGP11.phx.gbl...
I want to implement a collection property inside another (in a control
derived class) but I have some persistence problems.

There is an example of my ColumnItem class

<TypeConverter(GetType(ColumnItemConverter))> _

Public Class ColumnItem

Private m_strText As String

Private m_intWidth As Integer

Private m_imgImage As Image

Private m_colValueItems As ValueItemsCollection

Public Sub New()

'...

End Sub

Public Property Text() As String

Get

Return m_strText

End Get

Set(ByVal Value As String)

m_strText = Value

End Set

End Property

Public Property Width() As Integer

Get

Return m_intWidth

End Get

Set(ByVal Value As Integer)

m_intWidth = Value

End Set

End Property

<Editor(GetType(CollectionEditor), GetType(UITypeEditor)), _

DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)> _
Public ReadOnly Property ValueItems() As ValueItemsCollection

Get

Return m_colValueItems

End Get

End Property

'... other properties

End Class
I have a CollectionBase derived class object that contains all my
columnitems.
ValueItemsCollection is another CollectionBase derived class for my
sub-collection.
When I enter new columns in design time, nothing is serialized in the
InitializeComponent of the form.

Does anybody could send me some tips about how to do that?

Thanks

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.