[IronPython] IAttributesInjector

Huzaifa huzi_1982 at hotmail.com
Sat Aug 9 02:19:58 CEST 2008


Sample working example will be helpful 



Dino Viehland wrote:
> 
> It's located in Microsoft.Scripting.dll (not to be confused w/
> Microsoft.Scripting.Core.dll).
> 
> The way you use this is you apply the assembly level attribute like:
> 
> [assembly: ExtensionType(typeof(String), typeof(MyStringExtensions))]
> 
> And then you define MyStringExtensions:
> 
> public static class MyStringExtensions {
>       [SpecialName]
>         public static string GetCustomMember(string self, string name) {
>            return name;
>       }
> 
>       [SpecialName]
>         public static void SetMember(string self, string name, object
> value) {
>            Console.WriteLine("Set called, {0}, {1}", name, value);
>       }
> }
> 
> -----Original Message-----
> From: users-bounces at lists.ironpython.com
> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa
> Sent: Tuesday, July 29, 2008 11:31 AM
> To: users at lists.ironpython.com
> Subject: Re: [IronPython] IAttributesInjector
> 
> 
> I could not find it "Microsoft.Scripting.Runtime.ExtensionTypeAttribute"
> 
> Han Kejing wrote:
>>
>> Maybe is the "Microsoft.Scripting.Runtime.ExtensionTypeAttribute"
>> attribute.
>> You can found some simples in IronPythonTest project.
>>
>> ----------------------------------------------------------------
>> Follow my heart
>> Colin Han @ GrapeCity
>>
>> -----Original Message-----
>> From: users-bounces at lists.ironpython.com
>> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa
>> Sent: 2008年7月29日 15:26
>> To: users at lists.ironpython.com
>> Subject: [IronPython] IAttributesInjector
>>
>>
>> I can not find this interface in ironpython 2.0 .What is the alternative
>> if
>> this interface have been removed.
>> --
>> View this message in context:
>> http://www.nabble.com/IAttributesInjector-tp18701101p18701101.html
>> Sent from the IronPython mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
> 
> --
> View this message in context:
> http://www.nabble.com/IAttributesInjector-tp18701101p18718581.html
> Sent from the IronPython mailing list archive at Nabble.com.
> 
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 
> 

-- 
View this message in context: http://www.nabble.com/IAttributesInjector-tp18701101p18900900.html
Sent from the IronPython mailing list archive at Nabble.com.




More information about the Ironpython-users mailing list