473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

how to define System.Collections.Generic.ICollection<feedimage>

Hi i'm trying to pass a field of type
System.Collections.Generic.ICollection< FeedImage>
to a function.
I dont't have a clue what this icollection is.
but i tried some code

System.Collections.Generic.ICollection< FeedImage> imagea ;

FeedImage fee = new FeedImage ("http://www.image.com/image.jpg", "http://www.image.com");

imagea.Add(fee);

but i get an error that imagea is undefined but i don't know how to define it.

I tried System.Collections.Generic.ICollection< FeedImage> imagea = new System.Collections.Generic.ICollection< FeedImage> ();

and loads of other ways but they didn't work either.

I treid :
System.Collections.Generic.ICollection< FeedImage> imagea =null
but its generate a null error

someone help me please
Oct 23 '07 #1
2 2586
nateraaaa
663 Expert 512MB
Hi i'm trying to pass a field of type
System.Collections.Generic.ICollection< FeedImage>
to a function.
I dont't have a clue what this icollection is.
but i tried some code

System.Collections.Generic.ICollection< FeedImage> imagea ;

FeedImage fee = new FeedImage ("http://www.image.com/image.jpg", "http://www.image.com");

imagea.Add(fee);

but i get an error that imagea is undefined but i don't know how to define it.

I tried System.Collections.Generic.ICollection< FeedImage> imagea = new System.Collections.Generic.ICollection< FeedImage> ();

and loads of other ways but they didn't work either.

I treid :
System.Collections.Generic.ICollection< FeedImage> imagea =null
but its generate a null error

someone help me please
Try this code it should do the same thing.

List< FeedImage> imagea = new List<FeedImage>();

You can also loop through the collection list with this code.
foreach(FeedImage feedImage in imagea)
{
//do something here
}

Read up on C# Generics to get a better understanding of what their benefits are.

Nathan
Oct 23 '07 #2
Plater
7,872 Expert 4TB
System.Collections.Generic.ICollection is an interface. You will need to find an inheriting class. Anything in System.Collections.Generic should work (according to msdn)
Try:
Expand|Select|Wrap|Line Numbers
  1. LinkedList<FeedImage> = new LinkedList<FeedImage>();
  2.  
Oct 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Doug Dew | last post by:
This won't compile: using IEnumerable<T> = System.Collections.Generic.IEnumerable<T>; namespace MyNamespace { public class MyClass<T> : IEnumerable<T> { // Appropriate stuff here }
3
by: Abhi | last post by:
In the following hypothetical example I want to build a generic list of unique string items. How should I implement the pred function so that it returns true/false if target string exists in the...
6
by: Paul Delhanty | last post by:
Hi, I am converting an existing native C++ program making heavy use of STL to C#2.0 with STL usage replaced by the new generic collections. The conversion has gone well to the point where I am...
2
by: ljlevend | last post by:
I've noticed that in VS.NET 2.0 Beta 1 that none of the methods in System.Collections.Generic.List are overridable. In my app I currently have over 50 strongly typed ArrayLists that inherit from...
4
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from...
2
by: newscorrespondent | last post by:
I have a list declared: public System.Collections.Generic.SortedList<int, System.Collections.Generic.List<MTGTracer ActiveList = new SortedList<int,List<MTGTracer>>(); The key is an integer...
2
by: Polaris431 | last post by:
A property in some class shows up in the object browser as follows: public System.Collections.Generic.ICollection<DataSourceDataSources { get; } How do I access this property. I'm not sure...
2
by: Fred Heida | last post by:
Hi, i'm trying to (using managed C++) implment the IEnumerable<Tinterface on my class.. but have a problem with the 2 GetEnumerator method required.... what i have done is... ...
0
by: DR | last post by:
System.Collections.Generic.List<intmyList = new System.Collections.Generic.List<int>(100); Does this preallocate 100 integers? Also, is there any way to preallocate an array of objects all at...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.