Re: Pass type to method to allow create and method invocation?
- From: UL-Tomten <tomten@xxxxxxxxx>
- Date: Fri, 17 Aug 2007 09:32:23 -0700
On Aug 17, 4:59 pm, DeveloperX <nntp...@xxxxxxxxxxxxx> wrote:
Would that work? I read that as TScript must implement TScriptBase,
but we're passing in a class of type Type which does not.
Well, I would certainly recommend against passing a Type, because it
seems like something you would only do if late binding was your only
option. I got the impression your class hierarchy and its uses was
known at runtime, in which case the compiler and the CLR could do all
that work for you. But since I haven't the faintest clue about what
the bigger picture is, maybe a Type is what you need.
My knowledge might be muddied by the fact that it's a type of type
Type and Type might expose something that where understands...
No, I was only assuming a usage along the lines of, say:
DoExecute<ScriptCallInbound>(myScriptCallInbound);
Instead of passing a Type to DoExecute() and creating an instance
inside the method, wouldn't it make more sense to create an instance
outside the method and pass that?
.
- Follow-Ups:
- Re: Pass type to method to allow create and method invocation?
- From: Grant Schenck
- Re: Pass type to method to allow create and method invocation?
- From: DeveloperX
- Re: Pass type to method to allow create and method invocation?
- References:
- Re: Pass type to method to allow create and method invocation?
- From: DeveloperX
- Re: Pass type to method to allow create and method invocation?
- Prev by Date: Re: Correct and Specific Meaning of "Event Handler"
- Next by Date: Set up project uninstall C#
- Previous by thread: Re: Pass type to method to allow create and method invocation?
- Next by thread: Re: Pass type to method to allow create and method invocation?
- Index(es):
Relevant Pages
|