Thanks Robert,
Interesting, and I do understand ;-0) And yes, the curly braces may have made more sense I suppose.
Talking about Generics, I am making good progress with translating Nick's good 'DevShare 2015' sample involving Generics, BUT, this morning I thought I would visit your X# CHM notes and try some simple stuff for myself.
Since what follows is a general discussion, I have used images to help explain what I have done, and what the issues may be.
I went to the X# CHM file which came with Beta 10, and found the Generic example you wrote and included in the notes. I got the sample working for type INT, almost as you wrote it - just did a tweak so I could bind the Stack to a WPF control - see below :-
- RvdH_Generics_01.jpg (31.53 KiB) Viewed 447 times
And here is your coded slightly amended :-
- RvdH_Generics_02.jpg (133.51 KiB) Viewed 447 times
And here is my set-up in the Initialise method :-
- RvdH_Generics_03.jpg (36.67 KiB) Viewed 447 times
So then, what's the problem ? Well, it was when I took the next step to test things out. I thought the point of a Generic class was that I could use another type with it, say 'string' instead of 'int'. It was when I tried the 'string' type that I hit problems.
Here is the full Generic class I was suing :-
- RvdH_Generics_04.jpg (121.46 KiB) Viewed 447 times
And now the issue that I found when setting up a string example test :-
- RvdH_Generics_05.jpg (131.12 KiB) Viewed 447 times
Please can you tell me what needs changing / adding to the sample to get it to work successfully ?
Here is my test second Initialise method :-
- RvdH_Generics_06.jpg (72.21 KiB) Viewed 447 times
I know how to make Nullable types but don't know what to do to take 'string' and make it non nullable !?
Any pointers, suggestions, help etc., etc.. ?
TIA,
Phil.
Wales, UK.