Click here to Skip to main content
15,889,804 members
Home / Discussions / C#
   

C#

 
AnswerRe: Receiving Data on Socket Class Pin
André Kraak30-Sep-11 13:48
André Kraak30-Sep-11 13:48 
GeneralRe: Receiving Data on Socket Class Pin
Richard Andrew x6430-Sep-11 14:23
professionalRichard Andrew x6430-Sep-11 14:23 
QuestionGridView Template Field Value Pin
jashimu30-Sep-11 10:01
jashimu30-Sep-11 10:01 
AnswerRe: GridView Template Field Value Pin
Eddy Vluggen30-Sep-11 11:26
professionalEddy Vluggen30-Sep-11 11:26 
AnswerRe: GridView Template Field Value Pin
Perić Željko6-Oct-11 3:36
professionalPerić Željko6-Oct-11 3:36 
QuestionSettings/reading files attributes Pin
devvvy30-Sep-11 0:07
devvvy30-Sep-11 0:07 
AnswerRe: Settings/reading files attributes Pin
Pete O'Hanlon30-Sep-11 0:44
mvePete O'Hanlon30-Sep-11 0:44 
QuestionConstructing a Generic Class from several similar classes Pin
Wayne Gaylard29-Sep-11 23:21
professionalWayne Gaylard29-Sep-11 23:21 
I have several supporting classes that are all exactly the same except for one property, which is a List, something like this :-

C#
public class DecimalClass
    {
        public int x;
        public string y;
        public List<decimal> Details;
    }

    public class StringClass
    {
        public int x;
        public string y;
        public List<string> Details;
    }


Now in my main class I need to have several of these base classes , and so I thought of having one generic class like so :-

C#
public class MyClass<T>
    {
        public int x;
        public string y;
        public List<T> Details;
    }


and having a List<MyClass<T>> myClasses in my Main class, but this would mean the List would only be able to hold one Type, and I would need it to hold several different Types, the total number and Types of which would remain unknown until the class is created further down the line. If anyone can understand what I am trying to do, and can suggest a solution I would be more than grateful, as at the moment I am having to create a main class for each combination of sub classes that are required.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

AnswerRe: Constructing a Generic Class from several similar classes Pin
Pete O'Hanlon29-Sep-11 23:50
mvePete O'Hanlon29-Sep-11 23:50 
GeneralRe: Constructing a Generic Class from several similar classes Pin
Wayne Gaylard30-Sep-11 1:10
professionalWayne Gaylard30-Sep-11 1:10 
AnswerRe: Constructing a Generic Class from several similar classes Pin
lukeer30-Sep-11 1:21
lukeer30-Sep-11 1:21 
GeneralRe: Constructing a Generic Class from several similar classes Pin
Wayne Gaylard30-Sep-11 1:48
professionalWayne Gaylard30-Sep-11 1:48 
GeneralRe: Constructing a Generic Class from several similar classes Pin
lukeer30-Sep-11 2:55
lukeer30-Sep-11 2:55 
AnswerRe: Constructing a Generic Class from several similar classes Pin
BobJanova30-Sep-11 2:29
BobJanova30-Sep-11 2:29 
AnswerRe: Constructing a Generic Class from several similar classes Pin
Luc Pattyn30-Sep-11 2:40
sitebuilderLuc Pattyn30-Sep-11 2:40 
QuestionHow to use TextBoxRenderer in usercontrol Pin
Arjen H.29-Sep-11 21:11
Arjen H.29-Sep-11 21:11 
AnswerRe: How to use TextBoxRenderer in usercontrol Pin
Pete O'Hanlon29-Sep-11 22:31
mvePete O'Hanlon29-Sep-11 22:31 
GeneralRe: How to use TextBoxRenderer in usercontrol Pin
Arjen H.29-Sep-11 23:03
Arjen H.29-Sep-11 23:03 
QuestionHow to Controls the threads Pin
Anubhava Dimri29-Sep-11 20:04
Anubhava Dimri29-Sep-11 20:04 
AnswerRe: How to Controls the threads Pin
OriginalGriff29-Sep-11 21:37
mveOriginalGriff29-Sep-11 21:37 
QuestionProblem in facebook app using C# sdk Pin
rahul_galgali29-Sep-11 19:05
rahul_galgali29-Sep-11 19:05 
AnswerRe: Problem in facebook app using C# sdk Pin
killabyte29-Sep-11 20:14
killabyte29-Sep-11 20:14 
GeneralRe: Problem in facebook app using C# sdk Pin
rahul_galgali29-Sep-11 20:58
rahul_galgali29-Sep-11 20:58 
AnswerRe: Problem in facebook app using C# sdk Pin
Richard MacCutchan29-Sep-11 22:18
mveRichard MacCutchan29-Sep-11 22:18 
AnswerRe: Problem in facebook app using C# sdk Pin
Eddy Vluggen30-Sep-11 6:51
professionalEddy Vluggen30-Sep-11 6:51 

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.