Click here to Skip to main content
15,883,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to delete a string[] from list ??? Pin
manognya kota5-Jan-12 7:51
manognya kota5-Jan-12 7:51 
GeneralRe: how to delete a string[] from list ??? Pin
BillWoodruff5-Jan-12 16:24
professionalBillWoodruff5-Jan-12 16:24 
GeneralRe: how to delete a string[] from list ??? Pin
manognya kota5-Jan-12 17:47
manognya kota5-Jan-12 17:47 
AnswerRe: how to delete a string[] from list ??? Pin
Luc Pattyn5-Jan-12 7:59
sitebuilderLuc Pattyn5-Jan-12 7:59 
QuestionMessage Removed Pin
5-Jan-12 5:52
professionalN_tro_P5-Jan-12 5:52 
AnswerRe: Interfaces and Collections Pin
Sentenryu5-Jan-12 6:41
Sentenryu5-Jan-12 6:41 
GeneralMessage Removed Pin
5-Jan-12 6:53
professionalN_tro_P5-Jan-12 6:53 
GeneralRe: Interfaces and Collections Pin
Sentenryu5-Jan-12 7:11
Sentenryu5-Jan-12 7:11 
take a look at the List<T>
declaration:

C#
public class List<T> : IList<T>, ICollection<T>, 
	IEnumerable<T>, IList, ICollection, IEnumerable


i guess that the compiler generates a interface from IEnumerable<IGenericInterface> and makes all types generated for types that implement IGenericInterface implement that interface, so they are interchangeable.

think like this:

you have a Class A that implements interface I, and a Class B that also implements that interface, you can't write:

C#
A a = new A();
B b = new B();

a = b;


because, although they implement the same interface, they are not the same type.

i think the same concept can be applied to List<A> and List<I>, they are both types that implement IEnumerable<I>, but aren't the same type.

what i really need to search more it's this case:

C#
public IList<IGenericInterface> GetStuff()
{
   return new List<UsingGenericInterface>();
}


at this moment, i can't explain why it didn't work, but i'll discover

EDIT: i've forgotten about the < and > D'Oh! | :doh:
AnswerRe: Interfaces and Collections Pin
SledgeHammer015-Jan-12 10:38
SledgeHammer015-Jan-12 10:38 
QuestionRe: Interfaces and Collections Pin
Sentenryu5-Jan-12 10:48
Sentenryu5-Jan-12 10:48 
GeneralRe: Interfaces and Collections Pin
BillWoodruff5-Jan-12 16:46
professionalBillWoodruff5-Jan-12 16:46 
GeneralRe: Interfaces and Collections Pin
SledgeHammer015-Jan-12 16:59
SledgeHammer015-Jan-12 16:59 
AnswerRe: Interfaces and Collections Pin
BillWoodruff5-Jan-12 16:44
professionalBillWoodruff5-Jan-12 16:44 
GeneralRe: Interfaces and Collections Pin
SledgeHammer015-Jan-12 16:54
SledgeHammer015-Jan-12 16:54 
GeneralRe: Interfaces and Collections Pin
Sentenryu5-Jan-12 22:13
Sentenryu5-Jan-12 22:13 
GeneralRe: Interfaces and Collections Pin
BillWoodruff5-Jan-12 23:16
professionalBillWoodruff5-Jan-12 23:16 
AnswerRe: Interfaces and Collections Pin
BobJanova9-Jan-12 0:17
BobJanova9-Jan-12 0:17 
QuestionRichTextBox.TextLength vs RichTextBox.Text.Length Pin
morglorf5-Jan-12 5:49
morglorf5-Jan-12 5:49 
AnswerRe: RichTextBox.TextLength vs RichTextBox.Text.Length Pin
morglorf5-Jan-12 6:18
morglorf5-Jan-12 6:18 
GeneralRe: RichTextBox.TextLength vs RichTextBox.Text.Length Pin
Ravi Bhavnani5-Jan-12 7:58
professionalRavi Bhavnani5-Jan-12 7:58 
QuestionHow to read ocr image in MODI using visual studio? Pin
pervaizali5-Jan-12 4:22
pervaizali5-Jan-12 4:22 
AnswerRe: How to read ocr image in MODI using visual studio? Pin
OriginalGriff5-Jan-12 4:44
mveOriginalGriff5-Jan-12 4:44 
QuestionHow to read ocr image in visual studio using MODI? Pin
pervaizali5-Jan-12 4:20
pervaizali5-Jan-12 4:20 
QuestionClipping Line in WPF Pin
nhuvayday4-Jan-12 17:30
nhuvayday4-Jan-12 17:30 
QuestionCan you run application (built in C#) from PC to Mobile phone via Bluetooth Pin
LAPEC4-Jan-12 13:28
LAPEC4-Jan-12 13:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.