public WeakEventForwarder(IRowEventProvider source, IRowEventClient client) { if (source == null) throw new ArgumentNullException("source"); if (client == null) throw new ArgumentNullException("client"); this.source = source; this.clientRef = new WeakReference<IRowEventClient>(client); if (source.SourceTable != null) //RowListBinders might not have tables source.SourceTable.LoadCompleted += SourceTable_LoadCompleted; source.Schema.SchemaChanged += Schema_SchemaChanged; source.RowAdded += source_RowAdded; source.ValueChanged += source_ValueChanged; source.RowRemoved += source_RowRemoved; }
public WeakEventForwarder(IRowEventProvider source, IRowEventClient client) { if (source == null) { throw new ArgumentNullException("source"); } if (client == null) { throw new ArgumentNullException("client"); } this.source = source; this.clientRef = new WeakReference <IRowEventClient>(client); if (source.SourceTable != null) //RowListBinders might not have tables { source.SourceTable.LoadCompleted += SourceTable_LoadCompleted; } source.Schema.SchemaChanged += Schema_SchemaChanged; source.RowAdded += source_RowAdded; source.ValueChanged += source_ValueChanged; source.RowRemoved += source_RowRemoved; }
protected RowCollectionBinder(IRowEventProvider source) : base(source.Rows) { Source = source; new WeakEventForwarder(Source, this).ToString(); //The ctor registers the events; I never need the object again. }