[IronPython] Implementing an interface with ref parameters

Dino Viehland dinov at exchange.microsoft.com
Fri Aug 17 14:46:06 PDT 2007


I believe what we should be doing is passing you a Reference<T> object where T in this case is bool.  The Reference<T> object has a Value property which you can set and when you return the ref parameter should get updated.

Let me know if that doesn't work for you.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata
Sent: Friday, August 17, 2007 5:09 AM
To: users at lists.ironpython.com
Subject: [IronPython] Implementing an interface with ref parameters

Hi all,

I'm trying to implement a C# interface with methods that contains ref parameter, eg:

public interface IContent
{
   void BeginProcess(ref bool captureContent);
   void EndProcess(string content);
}

A straight implementation will not work because IronPython does not modify the captureContent value

class ImageGallery(IContent):
    def BeginProcess(captureContent):
        captureContent = False # This doesn't work.



--
nomadlife.org<http://nomadlife.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070817/26c3b058/attachment.html 


More information about the Users mailing list