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

C#

 
AnswerRe: Protecting from plugin crashes Pin
Rob Philpott31-Mar-11 1:34
Rob Philpott31-Mar-11 1:34 
QuestionBlocking threads - growing memory Pin
GDavy30-Mar-11 20:48
GDavy30-Mar-11 20:48 
AnswerRe: Blocking threads - growing memory Pin
Eddy Vluggen31-Mar-11 0:38
professionalEddy Vluggen31-Mar-11 0:38 
QuestionCast Action<T> to Action<object> [modified] Pin
Adriaan Davel30-Mar-11 20:36
Adriaan Davel30-Mar-11 20:36 
AnswerRe: Cast Action to Action Pin
Groulien30-Mar-11 22:01
Groulien30-Mar-11 22:01 
GeneralRe: Cast Action to Action Pin
Adriaan Davel30-Mar-11 22:37
Adriaan Davel30-Mar-11 22:37 
AnswerRe: Cast Action to Action Pin
Eddy Vluggen30-Mar-11 22:06
professionalEddy Vluggen30-Mar-11 22:06 
GeneralRe: Cast Action to Action Pin
Adriaan Davel30-Mar-11 22:32
Adriaan Davel30-Mar-11 22:32 
GeneralRe: Cast Action to Action Pin
Wayne Gaylard30-Mar-11 22:37
professionalWayne Gaylard30-Mar-11 22:37 
GeneralRe: Cast Action to Action Pin
Eddy Vluggen30-Mar-11 22:44
professionalEddy Vluggen30-Mar-11 22:44 
GeneralRe: Cast Action to Action Pin
Adriaan Davel30-Mar-11 22:49
Adriaan Davel30-Mar-11 22:49 
GeneralRe: Cast Action to Action Pin
Eddy Vluggen30-Mar-11 22:55
professionalEddy Vluggen30-Mar-11 22:55 
GeneralRe: Cast Action to Action Pin
Adriaan Davel30-Mar-11 23:02
Adriaan Davel30-Mar-11 23:02 
GeneralRe: Cast Action to Action Pin
Eddy Vluggen30-Mar-11 23:19
professionalEddy Vluggen30-Mar-11 23:19 
GeneralRe: Cast Action to Action Pin
PIEBALDconsult31-Mar-11 2:57
mvePIEBALDconsult31-Mar-11 2:57 
GeneralRe: Cast Action to Action Pin
Eddy Vluggen31-Mar-11 3:05
professionalEddy Vluggen31-Mar-11 3:05 
GeneralRe: Cast Action to Action Pin
J4amieC31-Mar-11 3:38
J4amieC31-Mar-11 3:38 
GeneralRe: Cast Action to Action Pin
Eddy Vluggen31-Mar-11 3:45
professionalEddy Vluggen31-Mar-11 3:45 
GeneralRe: Cast Action to Action Pin
J4amieC31-Mar-11 5:46
J4amieC31-Mar-11 5:46 
GeneralRe: Cast Action to Action Pin
Eddy Vluggen31-Mar-11 7:00
professionalEddy Vluggen31-Mar-11 7:00 
GeneralRe: Cast Action to Action Pin
PIEBALDconsult31-Mar-11 15:00
mvePIEBALDconsult31-Mar-11 15:00 
AnswerRe: Cast Action to Action Pin
Pete O'Hanlon30-Mar-11 22:34
mvePete O'Hanlon30-Mar-11 22:34 
The reason you can't do it is fairly simple. Action<T> is generic - fair enough, and you want it to be Action<object> - ok? Simplistically you would think this would work because no matter what type T was, it would ultimately be convertable to object, as everything derives from object.

Suppose though, that type T was a string, and you wanted to use Action<int> - all of a sudden, there's a conversion that is not implicitly possible - in other words, you would have to perform an explicit cast. The cast into object would have to be a special case in the compiler, so they chose not to do this - instead, like for like typing is the only way to achieve this.

I'm not a stalker, I just know things. Oh by the way, you're out of milk.

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Onyx


GeneralRe: Cast Action to Action Pin
Adriaan Davel30-Mar-11 22:46
Adriaan Davel30-Mar-11 22:46 
GeneralRe: Cast Action to Action Pin
Pete O'Hanlon30-Mar-11 23:21
mvePete O'Hanlon30-Mar-11 23:21 
GeneralRe: Cast Action to Action Pin
Adriaan Davel30-Mar-11 23:52
Adriaan Davel30-Mar-11 23:52 

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.