The docs for System.Type claims that you cannot subclass from it in 
Silverlight. Is this being relaxed in v5?


Keith Rome
Senior Consultant and Architect
MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS

Wintellect | 770.617.4016 | kr...@wintellect.com

www.wintellect.com

On Apr 14, 2011, at 6:49 PM, "Tomas Matousek" <tomas.matou...@microsoft.com> 
wrote:

> Couldn't you just subclass Type? It's methods are virtual and can be 
> overridden. I don't think you need to emit a real RuntimeType.
> 
> Tomas
> 
> -----Original Message-----
> From: users-boun...@lists.ironpython.com 
> [mailto:users-boun...@lists.ironpython.com] On Behalf Of Keith Rome
> Sent: Thursday, April 14, 2011 3:30 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] IronPython for Silverlight 5?
> 
> After looking into what it takes to implement ICustomTypeProvider it seems 
> like it would be a nightmare for dynamic object support. You have to produce 
> actual custom Type instances, presumably using TypeBuilder and emitting IL 
> opcodes to handle the getter/setter accessors. If the databinding system 
> caches those dynamically-created Types then it could cause problems because 
> what happens when we add a new member via expando after binding once (or 
> remove one that previously existed)? But if they don't cache the Type objects 
> then it seems like the overhead might be absurd from constructing these 
> things again and again (and you can't use TypeBuilder without first creating 
> a dynamic assembly and module).
> 
> I really hope they alter course and go with ICustomTypeDescriptor instead (or 
> even IDynamicMetaObjectProvider if that is feasible). I really don't 
> understand how they expect the current system to work for "dynamic 
> properties" because there is nothing dynamic at all about a System.Type 
> instance. The best it can hope to be is a snapshot of the metadata from a 
> dynamic object as of some point in time.
> 
> 
> Keith Rome
> Senior Consultant and Architect
> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS Wintellect | 770.617.4016 
> | kr...@wintellect.com www.wintellect.com
> 
> 
> -----Original Message-----
> From: users-boun...@lists.ironpython.com 
> [mailto:users-boun...@lists.ironpython.com] On Behalf Of Jeff Hardy
> Sent: Thursday, April 14, 2011 4:11 PM
> To: Discussion of IronPython
> Cc: Chad Brockman
> Subject: Re: [IronPython] IronPython for Silverlight 5?
> 
> On Thu, Apr 14, 2011 at 11:03 AM, Dino Viehland <di...@microsoft.com> wrote:
>> Jeff wrote:
>>> On Wed, Apr 13, 2011 at 11:14 PM, Chad Brockman <cha...@slb.com>
>>> wrote:
>>>> I see Silverlight 5 now has something besides simple reflection
>>>> (ICustomTypeProvider) -
>>>> 
>>>> http://msdn.microsoft.com/en-us/library/gg986857(v=VS.96).aspx#data
>>>> 
>>>> Will we see an update to Iron*/DLR to support binding to dynamic 
>>>> objects any time soon? This will open fantastic options for using 
>>>> IronPython in Silverlight.
>>> 
>>> If someone provides a patch, yes.
>>> 
>>> We actually need someone with an interest in Silverlight to keep an 
>>> eye on it and make sure that we don't break SL support and new 
>>> features like this. We don't have anyone in that role right now.
>> 
>> If anyone's interested on working on this it'd probably mean adding an 
>> implementation of this onto OldInstance as well as adding it onto our 
>> new-style instances whose classes are created by NewTypeMaker.  Adding 
>> the interface is probably pretty easy, making it return useful things may be 
>> a little more difficult.
>> 
>> I'm a little surprised they didn't go with the already existing 
>> ICustomTypeDescriptor.
> 
> Are you really surprised? :)
> 
> It is still in Beta. Maybe there's a slight chance their minds could be 
> changed? I'm guessing they don't have the rest of System.ComponentModel 
> either, so they didn't want to add just one interface.
> 
> - Jeff
> _______________________________________________
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 
> 
> _______________________________________________
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to