Click here to Skip to main content
15,885,757 members
Home / Discussions / C#
   

C#

 
QuestionHttpWebRequest Pin
TAREQ F ABUZUHRI30-May-07 5:11
TAREQ F ABUZUHRI30-May-07 5:11 
AnswerRe: HttpWebRequest Pin
kubben30-May-07 5:15
kubben30-May-07 5:15 
GeneralRe: HttpWebRequest Pin
TAREQ F ABUZUHRI30-May-07 5:30
TAREQ F ABUZUHRI30-May-07 5:30 
GeneralRe: HttpWebRequest Pin
kubben30-May-07 7:34
kubben30-May-07 7:34 
AnswerRe: HttpWebRequest Pin
TAREQ F ABUZUHRI30-May-07 5:21
TAREQ F ABUZUHRI30-May-07 5:21 
GeneralRe: HttpWebRequest Pin
TAREQ F ABUZUHRI30-May-07 5:26
TAREQ F ABUZUHRI30-May-07 5:26 
AnswerDon't crosspost Pin
leckey30-May-07 6:01
leckey30-May-07 6:01 
QuestionHow do I cast a generic list to a generic interface Pin
MBursill30-May-07 5:10
MBursill30-May-07 5:10 
I have the following interface
public interface IImage
{
    string FileName { get; set;}
    string Caption { get; set;}
}
I have a class called Image that implements the interface.

I create a BindingList of that Image object:
BindingList<Image> images = new BindingList<Image>();
I later want to store images in a list defined as the interface.
BindingList<IImage> = images; // casting error
Why am I getting a casting error? If I understand the rules of polymorphisms correctly, so long as my Image class implements IImage, I can store any Image as an IImage without needing to explicitly cast.

What to do? Confused | :confused:

-Mike.
AnswerRe: How do I cast a generic list to a generic interface Pin
Manoj Kumar Rai30-May-07 5:26
professionalManoj Kumar Rai30-May-07 5:26 
AnswerRe: How do I cast a generic list to a generic interface Pin
leppie30-May-07 22:42
leppie30-May-07 22:42 
QuestionHow reader information directory Pin
senalkan30-May-07 5:07
senalkan30-May-07 5:07 
AnswerRe: How reader information directory Pin
Manoj Kumar Rai30-May-07 5:34
professionalManoj Kumar Rai30-May-07 5:34 
AnswerRe: How reader information directory Pin
senalkan30-May-07 19:46
senalkan30-May-07 19:46 
GeneralRe: How reader information directory Pin
Manoj Kumar Rai30-May-07 21:21
professionalManoj Kumar Rai30-May-07 21:21 
GeneralRe: How reader information directory Pin
senalkan30-May-07 21:33
senalkan30-May-07 21:33 
QuestionDispose doubts Pin
Peterson Luiz30-May-07 4:21
Peterson Luiz30-May-07 4:21 
AnswerRe: Dispose doubts Pin
leppie30-May-07 4:47
leppie30-May-07 4:47 
AnswerRe: Dispose doubts Pin
Martin#30-May-07 5:06
Martin#30-May-07 5:06 
GeneralRe: Dispose doubts Pin
Peterson Luiz30-May-07 6:40
Peterson Luiz30-May-07 6:40 
AnswerRe: Dispose doubts Pin
Martin#30-May-07 8:46
Martin#30-May-07 8:46 
GeneralRe: Dispose doubts Pin
Peterson Luiz30-May-07 9:25
Peterson Luiz30-May-07 9:25 
AnswerRe: Dispose doubts Pin
Martin#30-May-07 10:17
Martin#30-May-07 10:17 
AnswerRe: Dispose doubts Pin
Jimmanuel30-May-07 6:30
Jimmanuel30-May-07 6:30 
Questionwant to make a folder sharable programatically Pin
devesh_code30-May-07 4:12
devesh_code30-May-07 4:12 
AnswerRe: want to make a folder sharable programatically Pin
Manoj Kumar Rai30-May-07 4:31
professionalManoj Kumar Rai30-May-07 4:31 

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.