![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Re: raising events by name What is the point of reflection if you can't do what you need (raise the event). If you are making a game engine and want to expose some classes through a scripting language and use reflection to make it work, this constraint will cause hard pain as you will have to implement that dictionnary in every class you want to expose to the scripting language, which could easily reach hundreds of classes, not to mention this dictionnary thing will become a performance issue. *** Sent via Developersdex http://www.developersdex.com *** |
My System Specs![]() |
| | #2 (permalink) |
| | Re: raising events by name Dude <dude@xxxxxx> wrote: Quote: > What is the point of reflection if you can't do what you need (raise the > event). doesn't happen to solve your immediate problem doesn't make it useless. Reflection doesn't solve world hunger, either... Quote: > If you are making a game engine and want to expose some classes through > a scripting language and use reflection to make it work, this constraint > will cause hard pain as you will have to implement that dictionnary in > every class you want to expose to the scripting language, which could > easily reach hundreds of classes, not to mention this dictionnary thing > will become a performance issue. have to have the same code repeated for every event. With the dictionary idea you could even implement a common interface for all of these classes, so it's clear what's supported. As for your performance concerns, they seem *incredibly* premature to me. Dictionary lookups are very cheap - and in the context of interpreting a scripting language, they're almost guaranteed to pale into insignificance. Oh, and dictionary lookups are usually cheaper than using reflection, too ![]() -- Jon Skeet - <skeet@xxxxxx> Web site: http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon_skeet C# in Depth: http://csharpindepth.com |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Raising the Text Changed Event of a text box | VB Script | |||
| Re: raising events by name | .NET General | |||
| Re: raising events by name | .NET General | |||