ID: 206
Viewed: 3434
Added: Apr 29, 2002
Version:
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo
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
<!---Declaration--->
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
Else
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
<!---Code--->
none;
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
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.