[IronPython] cannot access protected member without a pythonsubclass

Marty Nelson Marty.Nelson at symyx.com
Wed Jan 21 15:30:29 CET 2009


Your class is internal, do you mean "public class Serie"?

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Bernat Ràfales Mulet
Sent: Wednesday, January 21, 2009 5:25 AM
To: users at lists.ironpython.com
Subject: [IronPython] cannot access protected member without a pythonsubclass

Hello,

I'm trying to add scripting to an existing application in C#. My 
approach is to provide some Wrapper classes, that are instantiated and 
then passed to a python engine scope via the SetVariable method of the 
scope class. The problem is that one of those wrappers has a public 
property with the get and set methods, but when I try to access the 
property in the Python Script I get this error:
cannot access protected member ElementID without a python subclass of Serie.

The Serie class is simple:

using System;
using System.Collections.Generic;
using System.Text;

namespace Tango04.DashBoard.Scripting.Wrappers
{
    class Serie
    {
        public string Name { get; set; }
        public string ElementID { get; set; }
    }
}

The Python code I use is as simple as this:
ShowSerie = Serie.ElementID != 'somestring'

I instantiate a Serie object, fill it with the data, and then pass it as 
a variable to the script.

Anyone knows what I'm doing wrong?

Thanks!

=======
Notice: This e-mail message, together with any attachments, contains
information of Symyx Technologies, Inc. or any of its affiliates or
subsidiaries that may be confidential, proprietary, copyrighted,
privileged and/or protected work product, and is meant solely for
the intended recipient. If you are not the intended recipient, and
have received this message in error, please contact the sender
immediately, permanently delete the original and any copies of this
email and any attachments thereto.



More information about the Ironpython-users mailing list