Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is there a collection or structure that take three types? Pin
teknolog12317-Dec-10 1:08
teknolog12317-Dec-10 1:08 
AnswerRe: Is there a collection or structure that take three types? [modified] Pin
phil.o17-Dec-10 1:52
professionalphil.o17-Dec-10 1:52 
GeneralRe: Is there a collection or structure that take three types? Pin
Luc Pattyn17-Dec-10 3:17
sitebuilderLuc Pattyn17-Dec-10 3:17 
GeneralRe: Is there a collection or structure that take three types? Pin
phil.o17-Dec-10 4:50
professionalphil.o17-Dec-10 4:50 
GeneralRe: Is there a collection or structure that take three types? Pin
RaviRanjanKr17-Dec-10 3:22
professionalRaviRanjanKr17-Dec-10 3:22 
GeneralRe: Is there a collection or structure that take three types? Pin
phil.o17-Dec-10 4:47
professionalphil.o17-Dec-10 4:47 
GeneralRe: Is there a collection or structure that take three types? Pin
Lutosław18-Dec-10 13:59
Lutosław18-Dec-10 13:59 
AnswerRe: Is there a collection or structure that take three types? Pin
Eddy Vluggen17-Dec-10 8:53
professionalEddy Vluggen17-Dec-10 8:53 
If you're not using .NET 4, you might want to try Generics as an alternative;
C#
class SomeValue<T>
{
    public T FirstValue { get; set; }
}
class SomeValues<T, U>: SomeValue<T>
{
    public U SecondValue { get; set; }
}

class TooMuchValues<T, U, V>: SomeValues<T, U>
{
    public V ThirdValue { get; set; }
}


static void Main(string[] args)
{
    TooMuchValues<String, Int32, String> record = new TooMuchValues<String, Int32, String> ()
    {
        FirstValue = "Hello",
        SecondValue = 1,
        ThirdValue = "World"
    };
    Console.WriteLine ("{0}{1}{2}", record.FirstValue, new String(' ', record.SecondValue), record.ThirdValue);
}

You could add them to a List and enumerate them. I wouldn't recommend it outside prototyping-code though, as it doesn't improve readability (read 'maintainability').
I are Troll Suspicious | :suss:

QuestionRegular Expression pattern Pin
NarVish16-Dec-10 23:56
NarVish16-Dec-10 23:56 
AnswerRe: Regular Expression pattern Pin
Hiren solanki17-Dec-10 0:14
Hiren solanki17-Dec-10 0:14 
GeneralRe: Regular Expression pattern Pin
NarVish17-Dec-10 0:31
NarVish17-Dec-10 0:31 
AnswerRe: Regular Expression pattern Pin
Hiren solanki17-Dec-10 0:37
Hiren solanki17-Dec-10 0:37 
AnswerRe: Regular Expression pattern Pin
Ravi Sant17-Dec-10 0:20
Ravi Sant17-Dec-10 0:20 
GeneralRe: Regular Expression pattern Pin
Hiren solanki17-Dec-10 0:22
Hiren solanki17-Dec-10 0:22 
GeneralRe: Regular Expression pattern Pin
NarVish17-Dec-10 0:37
NarVish17-Dec-10 0:37 
GeneralRe: Regular Expression pattern Pin
Hiren solanki17-Dec-10 0:43
Hiren solanki17-Dec-10 0:43 
GeneralRe: Regular Expression pattern Pin
NarVish17-Dec-10 0:32
NarVish17-Dec-10 0:32 
AnswerRe: Regular Expression pattern Pin
Pete O'Hanlon17-Dec-10 0:37
mvePete O'Hanlon17-Dec-10 0:37 
GeneralRe: Regular Expression pattern Pin
NarVish17-Dec-10 1:05
NarVish17-Dec-10 1:05 
GeneralRe: Regular Expression pattern Pin
Pete O'Hanlon17-Dec-10 2:31
mvePete O'Hanlon17-Dec-10 2:31 
QuestionVSTO Word add-in 2007 Range.Find from background thread or worker Pin
Dino Mulahusic16-Dec-10 22:44
professionalDino Mulahusic16-Dec-10 22:44 
QuestionImage Upload and Resize Pin
Sudipta K Paik16-Dec-10 21:59
Sudipta K Paik16-Dec-10 21:59 
AnswerRe: Image Upload and Resize Pin
OriginalGriff16-Dec-10 22:16
mveOriginalGriff16-Dec-10 22:16 
JokeRe: Image Upload and Resize [modified] Pin
_Erik_17-Dec-10 3:21
_Erik_17-Dec-10 3:21 
QuestionEnumeration as Indexer: Is C# not the strongly-typed? Pin
Paul Selormey16-Dec-10 20:07
Paul Selormey16-Dec-10 20:07 

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.