Click here to Skip to main content
15,892,927 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Generic class with reference to another generic class Pin
Manfred Rudolf Bihy9-Feb-11 4:13
professionalManfred Rudolf Bihy9-Feb-11 4:13 
AnswerRe: Generic class with reference to another generic class Pin
Dave Kreskowiak9-Feb-11 4:16
mveDave Kreskowiak9-Feb-11 4:16 
GeneralRe: Generic class with reference to another generic class Pin
lukeer9-Feb-11 22:40
lukeer9-Feb-11 22:40 
GeneralRe: Generic class with reference to another generic class Pin
Dave Kreskowiak10-Feb-11 2:27
mveDave Kreskowiak10-Feb-11 2:27 
GeneralRe: Generic class with reference to another generic class Pin
lukeer10-Feb-11 3:11
lukeer10-Feb-11 3:11 
GeneralRe: Generic class with reference to another generic class Pin
Dave Kreskowiak10-Feb-11 6:32
mveDave Kreskowiak10-Feb-11 6:32 
AnswerRe: Generic class with reference to another generic class Pin
Pete O'Hanlon9-Feb-11 4:22
mvePete O'Hanlon9-Feb-11 4:22 
AnswerRe: Generic class with reference to another generic class Pin
Luc Pattyn9-Feb-11 5:11
sitebuilderLuc Pattyn9-Feb-11 5:11 
Hi,

this seems to do what you want, somewhat:

namespace Test_Foo {
    public class Foo<T, T2> {
        public T Tag;

        public Foo<T2, T2> _innerFoo;
    }


    public class Bar {
        public void Baz() {
            Foo<int, double> intFoo = new Foo<int, double>();
            intFoo.Tag = 5;

            intFoo._innerFoo = new Foo<double, double>();  // <<< second double is arbitrary
            intFoo._innerFoo.Tag = 1.25D;
        }
    }
}


However I don't know what purpose nesting those Foo's would serve as the inner Foo has its own inner Foo, etc.
My approach only works well for a nesting depth of 2, if your inner inner foo needs yet another type, you need to add another type parameter, etc.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: Generic class with reference to another generic class Pin
lukeer9-Feb-11 22:58
lukeer9-Feb-11 22:58 
GeneralRe: Generic class with reference to another generic class Pin
Nitin Singh India26-Mar-11 10:02
Nitin Singh India26-Mar-11 10:02 
GeneralRe: Generic class with reference to another generic class Pin
lukeer28-Mar-11 9:10
lukeer28-Mar-11 9:10 
QuestionHow publsiher-subscriber configurations can be included in a single app.config? Pin
glitteringsound8-Feb-11 6:59
glitteringsound8-Feb-11 6:59 
AnswerRe: How publsiher-subscriber configurations can be included in a single app.config? Pin
#realJSOP8-Feb-11 9:55
mve#realJSOP8-Feb-11 9:55 
GeneralRe: How publsiher-subscriber configurations can be included in a single app.config? Pin
glitteringsound9-Feb-11 4:52
glitteringsound9-Feb-11 4:52 
QuestionWCF webservice Pin
Pranit Kothari8-Feb-11 6:47
Pranit Kothari8-Feb-11 6:47 
AnswerRe: WCF webservice Pin
dan!sh 8-Feb-11 7:10
professional dan!sh 8-Feb-11 7:10 
QuestionAdding Row Numbers to DataGridView Pin
Member 22565337-Feb-11 5:27
Member 22565337-Feb-11 5:27 
AnswerRe: Adding Row Numbers to DataGridView Pin
Yusuf7-Feb-11 6:10
Yusuf7-Feb-11 6:10 
GeneralRe: Adding Row Numbers to DataGridView Pin
Member 22565337-Feb-11 6:56
Member 22565337-Feb-11 6:56 
AnswerRe: Adding Row Numbers to DataGridView Pin
Luc Pattyn7-Feb-11 8:19
sitebuilderLuc Pattyn7-Feb-11 8:19 
AnswerRe: Adding Row Numbers to DataGridView Pin
Member 22565337-Feb-11 7:08
Member 22565337-Feb-11 7:08 
AnswerRe: Adding Row Numbers to DataGridView Pin
GenJerDan7-Feb-11 9:32
GenJerDan7-Feb-11 9:32 
AnswerRe: Adding Row Numbers to DataGridView Pin
RobCroll8-Feb-11 1:07
RobCroll8-Feb-11 1:07 
QuestionI have this task but I don't know what I should do , Please help me. (get Factor) Pin
Honeyboy_206-Feb-11 0:15
Honeyboy_206-Feb-11 0:15 
AnswerRe: I have this task but I don't know what I should do , Please help me. (get Factor) Pin
Honeyboy_206-Feb-11 0:35
Honeyboy_206-Feb-11 0:35 

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.