public ReadOnlyIdentityCollection(IdentityCollection <T> collection)
 {
     identityCollection = collection ?? throw new ArgumentNullException(nameof(collection) + " can not be null");
     identityCollection.CollectionChangeAdded   += IdentityCollection_CollectionChangeAdded;
     identityCollection.CollectionChangeRemoved += IdentityCollection_CollectionChangeRemoved;
     identityCollection.CollectionChangeCleared += IdentityCollection_CollectionChangeCleared;
 }
 public override void Close()
 {
     if (identityCollection != null)
     {
         identityCollection.CollectionChangeAdded   -= IdentityCollection_CollectionChangeAdded;
         identityCollection.CollectionChangeRemoved -= IdentityCollection_CollectionChangeRemoved;
         identityCollection.CollectionChangeCleared -= IdentityCollection_CollectionChangeCleared;
         identityCollection = null;
     }
     base.Close();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Default constructor, uses <see cref="GuidIdentifier"/> as identifier.
 /// </summary>
 public IdentityTreeItem()
 {
     Identifier = new GuidIdentifier();
     children   = new IdentityCollection <T>();
     Children   = children;
 }