Suamere
Member
- Joined
- Aug 23, 2012
- Messages
- 11
- Programming Experience
- 5-10
I want to subscribe to changes in clsProperties because the changes are performed from Main and I want to take action in clsClass
This is a quick Breakdown:
I want Zero overhead in Main(), this is where user developers work.
MyInstance("x") automatically calls the Get clause of the Default Property of clsClass, creates or adds the ("x") to a dictionary(of string, clsProperties)... and returns that. After that, the Property of clsProperties is called (either Value or mask) and assigned whatever is assigned.
When one of these properties are set or changed, I want to loop through every dictionary item in clsClass and validate each one's clsProperties values.
Public Class MainClass Public Sub Main Dim MyInstance As New clsClass MyInstance("Me").Value = myName MyInstance("Me").Mask = myObject MyInstance("You").Value = yourName MyInstance("You").Mask = yourObject End Sub End Class Public Class clsClass Private oPC2 As New Dictionary(Of String, clsProperties) Default Property P(ByVal strString As String) As clsProperties Get If oPC2.ContainsKey(strString) = False Then _ oPC2.Add(strString, New clsProperties) Return oPC2(strString) End Get Set(ByVal value As clsProperties) End Set End Property End Class Public Class clsProperties Public Property Value As String Public Property Mask As Object End Class
This is a quick Breakdown:
I want Zero overhead in Main(), this is where user developers work.
MyInstance("x") automatically calls the Get clause of the Default Property of clsClass, creates or adds the ("x") to a dictionary(of string, clsProperties)... and returns that. After that, the Property of clsProperties is called (either Value or mask) and assigned whatever is assigned.
When one of these properties are set or changed, I want to loop through every dictionary item in clsClass and validate each one's clsProperties values.
Last edited: