Click here to Skip to main content
15,904,288 members
Home / Discussions / C#
   

C#

 
AnswerRe: Simple problem with brackets Pin
VengefulSakhmet4-Aug-09 10:53
VengefulSakhmet4-Aug-09 10:53 
QuestionRe: Simple problem with brackets Pin
Amangang4-Aug-09 22:49
Amangang4-Aug-09 22:49 
AnswerRe: Simple problem with brackets Pin
Henry Minute4-Aug-09 22:54
Henry Minute4-Aug-09 22:54 
GeneralRe: Simple problem with brackets Pin
Amangang4-Aug-09 22:59
Amangang4-Aug-09 22:59 
GeneralRe: Simple problem with brackets Pin
Amangang5-Aug-09 2:15
Amangang5-Aug-09 2:15 
GeneralRe: Simple problem with brackets Pin
VengefulSakhmet5-Aug-09 3:34
VengefulSakhmet5-Aug-09 3:34 
GeneralRe: Simple problem with brackets Pin
Amangang5-Aug-09 3:41
Amangang5-Aug-09 3:41 
QuestionCasting List<concreteclass> to IList<interfaceconcreclass></interfaceconcreclass></concreteclass> Pin
Ubirajara Mendes4-Aug-09 8:49
Ubirajara Mendes4-Aug-09 8:49 
Hi Guys,

this is my first post on Code Project, becouse everything i needed help I found on this forum, but for this inssue o don't find the answer.

So, my problem is:

- I have a class that implements an Interface e.g:

public interface IMyclass
{
   string Name {get; set;}
}

public class Myclass : IMyclass
{
   private string name;
   public string Name
   {
         get { return name; }
         set { name = value; }
   }
}

In one method I need return an IList<IMyclass> created as a List<Myclass> like this:
public IList<IMyclass> CreateList()
{
   IList<Myclass> listMyclass = new List<Myclass>();
   return (IList<imyclass>)listMyclass;
}

and the code that call the class expect a return of IList<IMyclass>, but this form generate an error saying that this cast is not possible.

anyone have an idea to solve this problem? I'm using Visual Studio 2005.

Thanks.

Ubirajara Mendes

AnswerRe: Casting List to IList Pin
Adam Maras4-Aug-09 9:31
Adam Maras4-Aug-09 9:31 
GeneralRe: Casting List to IList Pin
Ubirajara Mendes5-Aug-09 9:03
Ubirajara Mendes5-Aug-09 9:03 
AnswerRe: Casting List to IList Pin
Adam Maras5-Aug-09 11:13
Adam Maras5-Aug-09 11:13 
GeneralRe: Casting List to IList Pin
Ubirajara Mendes6-Aug-09 8:50
Ubirajara Mendes6-Aug-09 8:50 
Questiondrag n drop images Pin
strife194-Aug-09 7:39
strife194-Aug-09 7:39 
AnswerRe: drag n drop images Pin
Abhijit Jana4-Aug-09 8:08
professionalAbhijit Jana4-Aug-09 8:08 
QuestionFacotry Design Pattern Pin
jpk4204-Aug-09 6:49
jpk4204-Aug-09 6:49 
AnswerRe: Facotry Design Pattern Pin
Abhijit Jana4-Aug-09 6:56
professionalAbhijit Jana4-Aug-09 6:56 
AnswerRe: Facotry Design Pattern Pin
N a v a n e e t h4-Aug-09 7:05
N a v a n e e t h4-Aug-09 7:05 
QuestionUse of Interfaces Pin
jpk4204-Aug-09 6:47
jpk4204-Aug-09 6:47 
AnswerRe: Use of Interfaces Pin
Abhijit Jana4-Aug-09 7:05
professionalAbhijit Jana4-Aug-09 7:05 
AnswerRe: Use of Interfaces Pin
N a v a n e e t h4-Aug-09 7:18
N a v a n e e t h4-Aug-09 7:18 
AnswerRe: Use of Interfaces Pin
Luc Pattyn4-Aug-09 7:42
sitebuilderLuc Pattyn4-Aug-09 7:42 
Questionquery wizard Pin
mohammad alnoed4-Aug-09 6:46
mohammad alnoed4-Aug-09 6:46 
AnswerRe: query wizard Pin
Abhijit Jana4-Aug-09 7:00
professionalAbhijit Jana4-Aug-09 7:00 
GeneralRe: query wizard Pin
mohammad alnoed4-Aug-09 7:07
mohammad alnoed4-Aug-09 7:07 
GeneralRe: query wizard Pin
Henry Minute4-Aug-09 13:19
Henry Minute4-Aug-09 13:19 

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.