コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 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.
 }