Click here to Skip to main content
15,902,764 members
Home / Discussions / C#
   

C#

 
AnswerRe: Serializing an Interface in C# Pin
Lucian.Palcu10-Oct-07 6:05
Lucian.Palcu10-Oct-07 6:05 
Questionproblem in "Splash screen demo" tutorial Pin
mandeeep9-Oct-07 3:16
mandeeep9-Oct-07 3:16 
AnswerRe: problem in "Splash screen demo" tutorial Pin
Pete O'Hanlon9-Oct-07 3:24
mvePete O'Hanlon9-Oct-07 3:24 
AnswerRe: problem in "Splash screen demo" tutorial Pin
Dave Kreskowiak9-Oct-07 5:21
mveDave Kreskowiak9-Oct-07 5:21 
GeneralRe: problem in "Splash screen demo" tutorial Pin
mandeeep10-Oct-07 3:58
mandeeep10-Oct-07 3:58 
GeneralRe: problem in "Splash screen demo" tutorial Pin
Dave Kreskowiak10-Oct-07 14:01
mveDave Kreskowiak10-Oct-07 14:01 
QuestionPossible to have a List of Generic items of different types? Pin
Paul Brower9-Oct-07 2:43
Paul Brower9-Oct-07 2:43 
AnswerRe: Possible to have a List of Generic items of different types? Pin
Urs Enzler9-Oct-07 4:48
Urs Enzler9-Oct-07 4:48 
It isn't possible to have a strongly typed generic list that allows 2 different type parameters, but you can do something like that:

public class GenericDataElement
{
}

public class GenericDataElement<T> : GenericDataElement
{
public GenericDataElement(string name, T value)
{
this.name = name;
this.value = value;
}

private string name;

public string Name
{
get { return name; }
}

private T value;

public T Value
{
get { return value; }
}
}

public class Test
{
List<GenericDataElement> list = new List<GenericDataElement>();

public void TestIt()
{
list.Add(new GenericDataElement<string>("string", "value"));
list.Add(new GenericDataElement<int>("int", 1));


foreach (GenericDataElement gde in list)
{
if (gde is GenericDataElement<int>)
Console.WriteLine("int");
else
Console.WriteLine("string");
}
}
}


But you will have an untyped collection, of course.


-^-^-^-^-^-
no risk no funk ................... please vote ------>
QuestionKeys [modified] Pin
mihksoft9-Oct-07 2:26
mihksoft9-Oct-07 2:26 
AnswerRe: Keys Pin
Luc Pattyn9-Oct-07 3:49
sitebuilderLuc Pattyn9-Oct-07 3:49 
GeneralRe: Keys Pin
Martin#9-Oct-07 4:14
Martin#9-Oct-07 4:14 
GeneralRe: Keys Pin
Luc Pattyn9-Oct-07 4:47
sitebuilderLuc Pattyn9-Oct-07 4:47 
GeneralRe: Keys Pin
Martin#9-Oct-07 4:52
Martin#9-Oct-07 4:52 
GeneralRe: Keys Pin
Luc Pattyn9-Oct-07 5:52
sitebuilderLuc Pattyn9-Oct-07 5:52 
GeneralRe: Keys Pin
Martin#9-Oct-07 20:42
Martin#9-Oct-07 20:42 
QuestionHow to use Dunzip32.dll in my project? Pin
JSSUML9-Oct-07 2:01
JSSUML9-Oct-07 2:01 
AnswerRe: How to use Dunzip32.dll in my project? Pin
Andrei Ungureanu9-Oct-07 2:10
Andrei Ungureanu9-Oct-07 2:10 
GeneralRe: How to use Dunzip32.dll in my project? Pin
JSSUML9-Oct-07 2:41
JSSUML9-Oct-07 2:41 
AnswerRe: How to use Dunzip32.dll in my project? Pin
Colin Angus Mackay9-Oct-07 2:23
Colin Angus Mackay9-Oct-07 2:23 
GeneralRe: How to use Dunzip32.dll in my project? Pin
JSSUML9-Oct-07 2:43
JSSUML9-Oct-07 2:43 
QuestionError in Mail sending Pin
Exelioindia9-Oct-07 2:00
Exelioindia9-Oct-07 2:00 
AnswerRe: Error in Mail sending Pin
JSSUML9-Oct-07 2:04
JSSUML9-Oct-07 2:04 
QuestionExcel to DataTable Pin
vijay_chaudhary9-Oct-07 1:59
vijay_chaudhary9-Oct-07 1:59 
AnswerRe: Excel to DataTable Pin
Paul Conrad12-Oct-07 13:36
professionalPaul Conrad12-Oct-07 13:36 
QuestionA situation where you have to use goto Pin
Bummer89-Oct-07 1:57
Bummer89-Oct-07 1:57 

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.