Not a Member Yet,
Click here to Register
How do you like the new design?
It's cool, great job
[tally: 70%] 70%
It's okay
[tally: 20%] 20%
Its OK but I liked the old layout better
[tally: 0%] 0%
Please bring the old one back
[tally: 10%] 10%

votes: 10

ID: 206
Viewed: 2900
Added: Apr 29, 2002
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo

User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

This class holds a collection of CNode objects that fall under a given CNode in a CTree data structure.

Highlight all by clicking in box
Option Explicit

'local variable to hold collection
Private mCol As Collection
Private oParentSink As CNodeSink

Public Sub Clear()
Set mCol = New Collection
End Sub

Friend Property Set ParentSink(Sink As CNodeSink)
Set oParentSink = Sink
End Property

Public Function Add(Optional sKey As String) As CNode
'create a new object
Dim objNewMember As CNode
Set objNewMember = New CNode

'set the properties passed into the method
If Len(sKey) = 0 Then
mCol.Add objNewMember
mCol.Add objNewMember, sKey
objNewMember.Key = sKey
End If

Set objNewMember.ParentSink = oParentSink

'return the object created
Set Add = objNewMember
Set objNewMember = Nothing
End Function

Public Property Get Item(vntIndexKey As Variant) As CNode
Set Item = mCol(vntIndexKey)
End Property

Public Property Get Count() As Long
Count = mCol.Count
End Property

Public Sub Remove(vntIndexKey As Variant)
mCol.Remove vntIndexKey
End Sub

Public Property Get NewEnum() As IUnknown
Set NewEnum = mCol.[_NewEnum]
End Property

Private Sub Class_Initialize()
Set mCol = New Collection
End Sub

Private Sub Class_Terminate()
Set mCol = Nothing
Set oParentSink = Nothing
End Sub

Highlight All

No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.

Replying to a Comment...

Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2018 All Rights Reserved. Conditions