Dynamic Class Property

  • Thread starter Thread starter Vic
  • Start date Start date
Thx for the replay.
The reason for this, dependent of a setting i need a articleobject with
between 1 and 20 salesprices properties. But if it is not possible i will
code the 20 properties.

Vic

"rowe_newsgroups" <[email protected]> schreef in bericht
Can a property dynamic be added to a class at runtime?

Best Regards, Vic

Why would you need this?

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
The reason for this, dependent of a setting i need a articleobject with
between 1 and 20 salesprices properties. But if it is not possible i will
code the 20 properties.

Rather than code 20 properties, add a single property that is a List
(Of T) for holding your prices.

Private _salesPrices As List(Of Decimal)

Public ReadOnly Property SalesPrices As List(Of Decimal)
Public Get
Return _salesPrices
End Get
End Property

Then you can have as many or as few sales prices as you wish.

Chris
 
Back
Top