fuzzyman at voidspace.org.uk
Mon Mar 9 00:39:49 CET 2009
Jimmy Schementi wrote:
> Kristian wrote:
>> Just curios... Has anyone had time to look at my sample yet?
> Yes, and sorry for the horrifically late reply ...
> source is here:
> There was a few small changes I made to Michael's code:
> 1. The Python code used to load the C# assembly will fail, since there's no namespace defined as Scriptable. It should be change to:
> import ScriptableForString
In the actual source for download the namespace was defined. It was
omitted for brevity in the article. I'm adding it to avoid confusion in
> ... and "Scriptable.dll" doesn't need to be added to the AppManifest.xaml, just needs to be present in the XAP. I use clr.AddReferenceToFile because clr.AddReference or clr.AddReferenceByName can fail depending on whether or not Microsoft.Scripting.Silverlight.dll is signed (which can differ if you get the bits from codeplex or build them yourself from github), because you didn't give the fully-qualified assembly name.
Interesting. AddReference can fail if you put the dll in the xap file -
that sounds like a big scary gotcha.
> 2. The SomeClass class needs to take new_string as a parameter, instead of "string"
The _method returns new_string to indicate that it returns a new string
(and probably not the one you pass in). This is what the ellipsis in the
code body is for - to indicate the missing implementation.
> 3. There are both "some_class" and "someClass" variables, but there are intended to mean the same thing. So I changed them all to "someClass".
So onload isn't reliable - great.
> 5. http://jimmy.schementi.com/silverlight/scriptable/csharp/scriptable.cs MSDN documentation said that events need to be marked with ScriptableMemberAttribute, rather than ScriptableMember. I don't think I makes a difference ...
This applies to *all* of the references. I don't think ScriptableType
and ScriptableMember exist any more - thanks.
In the process of making these updates.
> Users mailing list
> Users at lists.ironpython.com
More information about the Ironpython-users