public sealed class EntitySet<TEntity> : IList, ICollection, IList<TEntity>, ICollection<TEntity>, IEnumerable<TEntity>, IEnumerable, IListSource where TEntity : class
{ public EntitySet(Action<TEntity> onAdd, Action<TEntity> onRemove);
}
public delegate void Action<T>(T obj);
private void attach_ToolClass(ToolClass entity)
{ this.SendPropertyChanging();
entity.ProductGroup = this;
}
private void detach_ToolClass(ToolClass entity)
{
this.SendPropertyChanging();
entity.ProductGroup = null;
}
_ToolClass = new EntitySet<ToolClass>(new Action<ToolClass>(this.attach_ToolClass), new Action<ToolClass>(this.detach_ToolClass));
上面一条语句生成一个ToolClass类型的集合, attach_ToolClass detach_ToolClass但到底有什么功效?怎么使用的?