addrange

ObservableCollection Doesn't support AddRange method, so I get notified for each item added, besides what about INotifyCollectionChanging?

I want to be able to add a range and get updated for the entire bulk. I also want to be able to cancel the action before it's done (i.e. collection changing besides the 'changed'). Related Q http://stackoverflow.com/questions/57020/which-net-collection-for-adding-multiple-objects-at-once-and-getting-notified ...

Why can't I use AddRange to add subclassed items?

I have two classes.... Parcel and FundParcel...and I'm trying to convert an IEnumerable of the subtype to an IList of the supertype.... public class FundParcel : Parcel { /* properties defined here */ } public class Parcel { /* properties defined here */ } These are used in another class in a method as follows: private IList<Par...

using a win form combo box Items.AddRange method

I have an array of objects that I'm trying to add to the Items collection of a combo box control using the AddRange method. The method takes an object[] but when I pass it the name of the array which has been intialized with some values, it complains: The best overloaded method match for 'System.Windows.Forms.ComboBox.ObjectCollection....

LINQ - Joining Lists in a linq Query

Question is How do a return a List of B with all the entities in children of all Parents without resorting to the type of code below, I was thinking u must be able to acheive the same within a single linq query? Class Parent { public Title, public children List<B>, } data = List<A> var childLists = from x in x.Parents select x...

Can't append one list to another in C#... trying to use AddRange.

Hi I'm trying to append 1 list to another. I've done it using AddRange() before but it doesn't seem to be working here... Here's the code: IList<E> resultCollection = ((IRepository<E, C>)this).SelectAll(columnName, maxId - startId + 1, startId); IList<E> resultCollection2 = ((IRepository<E, C>)this).SelectAll(columnName,...

List<T>.AddRange implementation suboptimal

Profiling my C# application indicated that significant time is spent in List<T>.AddRange. Using Reflector to look at the code in this method indicated that it calls List<T>.InsertRange which is implemented as such: public void InsertRange(int index, IEnumerable<T> collection) { if (collection == null) { ThrowHelper.Throw...

How to use Combo Box AddRange in WPF C#

Hi everyone, I have a little problem, I have an array and I want to add that in a Combobox, so I want to use the AddRange method, but it isn't available in WPF, is there a way that I can do it in the combobox? Thanks. ...

IronPython - Adding items very fast to a GUI ListView object

Hello, I'm using IronPython 2.6, Sharpdevelop 3.2 for GUI building and compiling, Pydev on Eclipse for writing the code and debugging. I recently had some trouble using IronPython and ListView objects. In my usecase I wanted to add ListViewItems i created in a thread very fast to an GUI ListView object. First problem I ran into was ...

c# Linq `List<Interface>.AddRange` Method Not Working

I have an interface defined as below: public interface TestInterface{ int id { get; set; } } And two Linq-to-SQL classes implementing that interface: public class tblTestA : TestInterface{ public int id { get; set; } } public class tblTestB : TestInterface{ public int id { get; set; } } I have IEnumerable lists a and b...

AddRange/concat functionality inside a lambda Select expression

class Foo { int PrimaryItem; bool HasOtherItems; IEnumerable<int> OtherItems; } List<Foo> fooList; How do I get a list of all item ids referenced inside fooList? var items = fooList .Select( /* f => f.PrimaryItem; if (f.HasOtherItems) AddRange(...