You can use the transparent activation aware collections directly in your code. They behavior is the same as the .NET-collections. Here are a few tips:
An example:
public class Team : ActivatableBase { private readonly IList<Pilot> pilots = new ActivatableList<Pilot>(); public void Add(Pilot pilot) { Activate(ActivationPurpose.Write); pilots.Add(pilot); } public ICollection<Pilot> Pilots { get { Activate(ActivationPurpose.Read); return pilots; } } }
Public Class Team Inherits ActivatableBase Private ReadOnly m_pilots As IList(Of Pilot) = New ActivatableList(Of Pilot)() Public Sub Add(ByVal pilot As Pilot) Activate(ActivationPurpose.Write) m_pilots.Add(pilot) End Sub Public ReadOnly Property Pilots() As ICollection(Of Pilot) Get Activate(ActivationPurpose.Read) Return m_pilots End Get End Property End Class
Currently these collections are available: