c# - Binding a BindingList to a collection -


I have a library that provides a collection like this:

Public IEnumerable Alert {. .}

And I want to convert this collection to a binding list for use in the GUI. What is the best way to get a bindings list synchronized with an inimerable collection?

Edit: For this problem, assume that I have no control over the library and uses the actual implementation list.
But I do not want to touch this code

This library has a good interface with AddAlert, RemoveAlert etc. What is the best way to synchronize the GUI with all these changes?

Assume the class you are wrapping, assume that insert Things like, you just click the from the bidding list & lt; T & gt; , overriding some major methods - like something:

  class MyList & lt; T & gt; : Baiding list & lt; T & gt; {Private Redoni Fu & lt; T & gt; wrapped; Public Malice (Foo & Lt; T & gt; Wrapped): Base (new list; T & gt; (wrapped. ITIs)) {this.wrapped = wrapped; } Secure Override Zero Insert InsertItem (Int Indexes, T Items) {wrapped.Insert (index, item); Base.InsertItem (index, item); } Safe override zero RemoveItem {int index} {wrapped.Remove (this [index]); Base.RemoveItem (index); } Secure Override Zero ClearTimes () {wrapped.Clear (); Base.ClearItems (); } // possibly also setIT}  

This list should result in being in sync because you manipulate them.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -