That works great! Thanks Dino.
-Steve

--------------------------------------------------
From: "Dino Viehland" <[email protected]>
Sent: Wednesday, March 03, 2010 7:27 PM
To: "Discussion of IronPython" <[email protected]>
Subject: Re: [IronPython] DocString for properties

Steve wote:
Hi guys,
I've been struggling with getting at the documentation string for a
static
property defined in one of my C# classes from IronPython.

Say my C# class had a public static property that returned an int.
public class MyClass
{
  ///<summary>My property summary</summary>
  public static int MyProperty{ get{return 1;} }
}

If I use the following python script to call help, I get help
information on
the int data type (I can understand why this is happening).

help( MyLib.MyClass.MyProperty )

You'll need to go into the type's dictionary and pull out the actual
descriptor object and access the __doc__ attribute from there.  For
example:

import System
print System.Environment.__dict__['CurrentDirectory'].__doc__

Gets or sets the fully qualified path of the current working
directory.


Get: CurrentDirectory() -> str
Set: CurrentDirectory() = value



_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to