generic-list

C#: How can I solve "Collection was modified" in a BackgroundWorker progress report callback?

I've used BackgroundWorkers quite a bit, but I've never experienced this problem before. My program analyses the output from a logic analyser producing packets, of which there are thousands. To prevent too much delay updating the ListView in my form (I was previously reporting each one as it was found, and the form was completely unrespo...

trouble in converting Generic List coming from a WCF Service to a DataTable

I am confused on how can I use generic methods to parse generic list into datatable/dataset. My setup: 1. I have a class Customers defined in WCF Service Library. namespace Wcf.Sample.ServiceLibrary { public class Customers { public string ID = string.Empty; public string CompanyName = string.Empty; publi...

How to compare List<String> to DB Table using LINQ

I have a list<> of phone numbers and I am trying to join that with the corresponding records in the db table and get an order number and a customer ID. Also the list has the whole number as one string and the DB has it broken to area code, prefix, number each as separate fields. I am fairly new to LINQ, so this is a beyond what I curren...

Creating a base class based in List<T>

I have a need to create a couple of classes that will serve as base classes for some data functionality I want to implement. The first, we'll call SessionObjectDataItem looks like this ... public class ObjectSessionDataItem { public int ID { get; set; } public bool IsDirty { get; set; } public bool IsNew { get; set; } public...

C# - Can you loop through types separately in a generic list?

I have 3 different classes, a generic "entity" class, and then two classes that inherit this, a bullet class and an enemy class. I then have a list of the entity class, with the bullets and enemies in the list, and a lot of the places I treat these the same. However, some times, I want to loop through just one of the classes, and not th...

Different types linked list.

creating a linked_list generic class that enables you to create a chain of objects of different types. ...

Speeding up the loading of a List of images

I'm loading a List<Image> from a folder of about 250 images. I did a DateTime comparison and it takes a full 11 second to load those 250 images. That's slow as hell, and I'd very much like to speed that up. The images are on my local harddrive, not even an external one. The code: DialogResult dr = imageFolderBrowser.ShowDialog(); if(d...