The keyword arguments you've seen used on CLR classes are actually using properties as initializers. That is,<br><br>tb = System.Windows.Forms.TextBox(Text = 'Hello')<br><br>is exactly equivalent to<br><br>tb = System.Windows.Forms.TextBox()<br>
tb.Text = 'Hello'<br><br><div class="gmail_quote">On Wed, Nov 26, 2008 at 12:38 AM, Dave Moor <span dir="ltr"><<a href="mailto:D.Moor@sim-soft.co.uk">D.Moor@sim-soft.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font style="font-family: tahoma; font-size: 10pt;"><div style="font-family: tahoma; font-size: 10pt;">Hi Everyone</div><div> </div><div>I am
developing a C# application using VS2005 and IronPython v1.1.0 (currently).
I am trying to add a function to a C# class that will be callable from
IronPython which will take a keyword argument list mimicking:</div><div>
</div><div>def fred(self, name, **kwargs):</div><div> </div><div>
I found this link <font><font style="font-family: tahoma; font-size: 10pt;">
<a href="http://blogs.msdn.com/srivatsn/archive/2008/09/09/passing-keyword-args-to-c-methods-from-ironpython.aspx" target="_blank">http://blogs.msdn.com/srivatsn/archive/2008/09/09/passing-keyword-args-to-c-methods-from-ironpython.aspx</a>
but I don't have Microsoft</font></font>.Scripting available. </div>
<div> </div><div>However IronPython allows kwargs on contructors of
standard clr classes like System.Windows.Forms.TextBox etc., can I use the
same magic as that? </div><div> </div><div>I looked in the source
of v1.1.2, do I need to do 'something' with
IronPython.Runtime.Calls.KwArgBinder and if so what? Is there a sample
somewhere I've missed? Or is it covered in IronPython in Action, if so
I guess I'd better stick my hand in my pocket :)</div><div> <br></div>
<div>Thanks in advance</div><div><br></div><div>Dave<br> </div></font>
<br>--<br>
Registered Office<br>
Mill House, Hawksworth Road, Horsforth, Leeds, LS18 4JP England.<br>
Reg No. 1311728 Eng.<br>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>