Milan said:
Exceprion says there is Parameter conflict, but VS(exception report too) is
installed on German language so that is why I did not included it here.
Options include temporarily switching your configured language to
English so that you can get the English version of the exception, or at
least reporting the actual type name of the exception (which is always
in English), or providing _some_ translation of the exception message,
or some combination of the above.
Code is available so exceprion was easy to reproduce.
That's true. That doesn't mean it's not a good idea to provide that
information yourself. Not everyone actually has a running version of
Windows with Visual Studio handy when they are replying to newsgroup
posts (for example, I'm using my Mac, and don't have Windows up at the
moment).
The less information you provide, the more likely it is you will have to
wait, sometimes indefinitely, for a useful reply. It's for your own
benefit to provide as much information as possible.
Please do not try to
understand sence of algorithm exposed here because it is just equivalent copy
of the real project beeing too big to copy/uderstand here.
If you fail to post a code example that is truly representative of the
code you're trying to deal with, then you will fail to receive answers
to your question that are truly applicable to the problem you're trying
to solve.
I find it unlikely that the design you're working with, in which you
feel it necessary to use reflection for something simple like this, is
the correct one. But there's no way for anyone to provide any useful
advice regarding better alternatives without a proper code example.
[...] But one more question is there any good tutorial
about Invoke function ? Invoke have one set of argument for normal/member
function second for static third for extension methods.... is there any
simple rule ?
Your "second" and "third" are the same. An extension method is nothing
more than a plain old static method, with some extra syntax to allow the
compiler at _compile_ time to use it as part of overload resolution.
At run-time, there's nothing special about extension methods at all.
They are just like any other static method. (In fact, at compile time
you can execute them explicitly just like any other static method too,
if you like).
Thus, there really shouldn't be any need for a tutorial on the
MethodInfo.Invoke() method. The documentation already covers all of the
specifics you need to know.
Pete