This is a method that should take already assigned users out of a list
and keep non-assigned ones in a list. The GuidList has the userId added
to it on a button click. The profileList is used to populate a gridView.
Here is the code:
private VList<VW_profiles> FilterAssigned(VList<VW_profiles> profileList)
{
VList<VW_profiles> sorted...
I have read many posts on this topic; among them and most recently .NET - Convert Generic Collection to Data Table. Unfortunately, all to no avail.
I have a generic collection of structures :
Private Structure MyStruct
Dim sState as String
Dim lValue as Long
Dim iLayer as Integer
End Structure
Dim LOStates As New List(Of MyStruct)
I...
I have a class, Questionnaire, which contains a collection class that wraps a generic list, EntityCollection. I am using ViewState to persist the Questionnaire and its collection of Questions. I am using custom type converters to reduce the ViewState size. Everything works without a type converter for EntityCollection. Would things wo...
I am trying to create a function that accepts a generic List<T> and iterates the list returning an excel file byte[]. The function needs be able to determine the objects properties. So if i pass a List<person> and person has properties first, last, age, etc i need to be able to determine the property names in order to create the excel co...
I am trying to figure out how to check if testInt exists in all Car.SomeID in List
So:
int testInt = 10;
List<Car> myCars = GetCars();
I want to see if there is a match on 10 in any of myCards.SomeID
...
We have a small framework written in C# .Net 2.0 that we want to expose to COM.
Problem is, we have some generic classes that would be exposed as the following:
interface IOurClass
{
ReadonlyCollection<IOurListObject> OurCollection
{
get;
}
}
interface IOurListObject
{
//Some properties that don't matter
}
What is the be...
Hello,
I have 2 objects Project and License. They both inherit from the object Entity (abstract class).
Now I have an extension method "GetNewId" that contains logic to get the next id in a list of entities.
I've defined this method as an extension method, but the problem is that List (which is also a list of entities) and List don't ...
In a jsp file I have this declaration:
<jsp:useBean scope="request" id="products" class="java.util.ArrayList<sgt.supermarket.entity.Product>"/>
This declaration works fine with GlassFish 2.1, however, when I switch to Tomcat 6.0, exceptions is thrown:
The value for the useBean class attribute java.util.ArrayList is invalid.
Is there...
I have a generic list that I'm removing items out of using List.Remove(Object). I have been removing items but whenever I get to the fifth item I'm removing it fails and does not remove it from the list. It doesn't seem to matter what I'm removing but everytime I try to remove five items it fails on the fifth item.
What could be causin...
I have written a List`1 editor template for use with the EditorFor extension methods (MVC2), however I am running into issues when using generics + null objects.
Given a model
class MyModel {
public Foo SomeFoo { get;set; }
public List<Foo> SomeFooList { get;set; }
}
and a template in /Views/Shared/EditorTemplates/List`1.ascx
...
I have an existing bit of code for sorting a list of objects.
productsList.Sort(
delegate(Product p1, Product p2)
{
int result = p1.StartDatetime.CompareTo(p2.StartDatetime);
if (result == 0)
{
if (p1.SomeId == p2.SomeId)
{
result = 0;
}
else if ...
I have the following test code to search a generic list:
public void DoSearch(string searchTerm)
{
IList<MyEntity> entities = GetCollectionOfEntities();
IList<MyEntity> results = entities.Where(d => d.Description.Contains(searchTerm)).ToList();
}
I want to pass an order by parameter (which would be a property of MyEntity) and of co...
First of all, it very well could be that I'm approaching my problem the wrong way, in which case I'd gladly accept alternatives.
What I'm trying to achieve is to detect which drive was created after a USB device has been connected to a computer.
Here is the simplified workflow:
// Get list of removable drives before user connects the ...
I am a threading noob and I am trying to write a custom thread safe generic list class in C# (.NET 3.5 SP1). I've read Why are thread safe collections so hard?. After reviewing the requirements of the class I think I only need to safely add to the list and return the list. The example shows pretty much all I want except it lacks the retu...
I asked a question about building custom Thread Safe Generic List now I am trying to unit test it and I absolutely have no idea how to do that. Since the lock happens inside the ThreadSafeList class I am not sure how to make the list to lock for a period of time while I am try to mimic the multiple add call. Thanks.
Can_add_one_item_at_...
Im really having trouble fixing my code, was wondering if there was anyone out there who could help me.
Basically im getting the following error:
The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)
The following are my classes:
Program Class:
using System;
using System.Coll...
I have a strong type view of type
List<List<MyViewModelClass>>
The outer list will always have two lists of List<MyViewModelClass>. For each of the two outer lists I want to display a group of checkboxes. Each set can have an arbitrary number of choices.
My view model class looks similar to this:
public class MyViewModelClass
{
...
I'm refatoring a home-grown DAO container, hoping to make the class generic. It internally uses an ArrayList to store the retrieved objects.
One usage of this class puts the container's list into a request scope, and due to a limitation of Websphere, I can't pass the generic List<Foo> to the request scope (Websphere doesn't handle gener...
Hi,
i basically want to know the differences or advantages in using a generic list instead of an array in the below mentioned scenario
Class Employee
{
private _empName;
Public EmpName
{
get{return _empName;}
set{_empName = value;}
}
}
1. Employee[] emp
2. List<Employee> emp
can anyone please tell me the advantages or disadvan...
As I iterate through a DataTable object, I need to check each of its DataRow objects against the items in a generic string List.
I found a blog post using the List's Find method along with a delegate, but whereas that example has a separate class (Person), I'm attempting something like the following using an instance of the string objec...