On Sun, Jul 13, 2008 at 7:20 PM, Dino Viehland <[EMAIL PROTECTED]> wrote: > Ahh I see what you mean now. If you're doing this from the hosting APIs you > can use the ObjectOperations class to do the conversion: > > someObj.someEvent += objOps.ConvertTo<DelegateType>(obj);
That is disturbingly easy. I knew you'd know the answer. But I wonder if that would work for removing a handler from an event? someObj.someEvent += objOps.ConvertTo<DelegateType>(obj); someObj.someEvent -= objOps.ConvertTo<DelegateType>(obj); One workaround might be to cache the delegate on the way in and use the cached delegate to remove it. _cache[obj] = objOps.ConvertTo<DelegateType>(obj); someObj.someEvent += _cache[obj] someObj.someEvent -= _cache[obj] But maybe there's a better way, or maybe I'm daft and it'll just work. -Dan _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
