Re: [IronPython] .NET Events in IronPython

2005-11-14 Thread Keith J. Farmer
You'd need to add an event keyword, or some other marker, wouldn't you? Otherwise you don't know that it should be an event rather than some other property. From: [EMAIL PROTECTED] on behalf of Martin Maly Sent: Mon 11/14/2005 5:23 PM To: Discussion of IronPyth

Re: [IronPython] .NET Events in IronPython

2005-11-14 Thread Martin Maly
After playing with this for a bit, I think that at the moment IronPython is not capable of what you can do below in C#. The insurmountable (for now, I hope) obsctacle that I hit is that the events must be sealed classes, inherited from an abstract MulticastDelegate. IronPython doesn't know o

Re: [IronPython] C# code calling IP subclass weirdness

2005-11-14 Thread Ernst, Nathan
I’m not certain if this is the cause of the problem – but have you tried making “DoSomething” on Helper virtual?  My guess would be that in your example, you’re creating a new, non-virtual method in FooHelper that is hiding its base class’s implementation, analogous to this:   using Syste

Re: [IronPython] C# code calling IP subclass weirdness

2005-11-14 Thread Michael Shilman
Doh. I introduced a bug when reducing my complex actual bug to this toy example. I added "virtual" to the C# program where it should have been, and now it works fine. Now I need to figure out where things are going awry in my actual example, where things are a bit more complicated (and the met

Re: [IronPython] C# code calling IP subclass weirdness

2005-11-14 Thread msurel
In C#, if you want somebody to be able to override a method in a base class, I think you need the virtual keyword. I believe if you define the DoSomething method in Helper with the virtual keyword, then you should be ok. That would be about the only suggestion I have. Other than that, the code l

[IronPython] C# code calling IP subclass weirdness

2005-11-14 Thread Michael Shilman
A question about subclassing, virtual methods, C#/IP interop, etc in IronPython-0.9.4.  I have a library of two classes Helper & Master (greatly simplified from my actual situation, but analagous):   using System; namespace TestLib {     public class Helper     {     int _id;