Click here to Skip to main content
15,905,686 members
Home / Discussions / C#
   

C#

 
QuestionProgramming C # Pin
Immanuel Hitila26-Oct-20 12:10
Immanuel Hitila26-Oct-20 12:10 
AnswerRe: Programming C # Pin
Pete O'Hanlon26-Oct-20 12:16
mvePete O'Hanlon26-Oct-20 12:16 
GeneralRe: Programming C # Pin
Immanuel Hitila26-Oct-20 12:21
Immanuel Hitila26-Oct-20 12:21 
AnswerRe: Programming C # Pin
Richard Andrew x6426-Oct-20 14:06
professionalRichard Andrew x6426-Oct-20 14:06 
AnswerRe: Programming C # Pin
OriginalGriff26-Oct-20 21:14
mveOriginalGriff26-Oct-20 21:14 
QuestionHow to launch a form only once Pin
Ismael_199926-Oct-20 7:57
Ismael_199926-Oct-20 7:57 
AnswerRe: How to launch a form only once Pin
OriginalGriff26-Oct-20 8:35
mveOriginalGriff26-Oct-20 8:35 
GeneralRe: How to launch a form only once Pin
Ismael_199926-Oct-20 10:09
Ismael_199926-Oct-20 10:09 
GeneralRe: How to launch a form only once Pin
OriginalGriff26-Oct-20 21:15
mveOriginalGriff26-Oct-20 21:15 
GeneralRe: How to launch a form only once Pin
Ismael_199927-Oct-20 10:40
Ismael_199927-Oct-20 10:40 
GeneralRe: How to launch a form only once Pin
OriginalGriff27-Oct-20 10:42
mveOriginalGriff27-Oct-20 10:42 
AnswerRe: How to launch a form only once Pin
Gerry Schmitz26-Oct-20 14:50
mveGerry Schmitz26-Oct-20 14:50 
AnswerRe: How to launch a form only once Pin
Richard Deeming26-Oct-20 22:10
mveRichard Deeming26-Oct-20 22:10 
QuestionDesign an elegant solution for choosing a class whose method gets called Pin
Member 1497555126-Oct-20 6:13
Member 1497555126-Oct-20 6:13 
AnswerRe: Design an elegant solution for choosing a class whose method gets called Pin
Gerry Schmitz26-Oct-20 14:58
mveGerry Schmitz26-Oct-20 14:58 
Questionan apparent violation of C#-generic "physics" ? (language issue) Pin
BillWoodruff25-Oct-20 22:18
professionalBillWoodruff25-Oct-20 22:18 
AnswerRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
pkfox25-Oct-20 22:58
professionalpkfox25-Oct-20 22:58 
GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
BillWoodruff25-Oct-20 23:15
professionalBillWoodruff25-Oct-20 23:15 
GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
pkfox25-Oct-20 23:59
professionalpkfox25-Oct-20 23:59 
GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
BillWoodruff26-Oct-20 2:13
professionalBillWoodruff26-Oct-20 2:13 
GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
pkfox26-Oct-20 2:48
professionalpkfox26-Oct-20 2:48 
GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
F-ES Sitecore26-Oct-20 1:15
professionalF-ES Sitecore26-Oct-20 1:15 
If you call

SetCache(x);


and "x" is type string then it compiles

SetCache<string>(x);


if "x" is an int then it compiles

SetCache<int>(x);


whatever type "x" is it assumes the type between the angled brackets is that type. The only time you absolutely have to supply the type is when the IDE can't work out itself what the type is. For example if you have

T GetCache<T>(string key)


then the IDE can't workout what "T" should be from the params

GetCache("username");


In the above code there is no way to work out what GetCache returns so you have to explicitly say;

GetCache<string>("username");

GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
BillWoodruff26-Oct-20 2:09
professionalBillWoodruff26-Oct-20 2:09 
GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
Richard MacCutchan26-Oct-20 2:38
mveRichard MacCutchan26-Oct-20 2:38 
GeneralRe: an apparent violation of C#-generic "physics" ? (language issue) Pin
F-ES Sitecore26-Oct-20 2:55
professionalF-ES Sitecore26-Oct-20 2:55 

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.