Hi, I''ve created this module to implement INotifyPropertyChanged in classes for databinding with WPF, but the way I''m handling the event seems a bit awkward. So I''m just checking if I''m doing it right. The lines of interest would be around line 76 of the link below http://gist.github.com/316765#file_app.rb --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero - Mob: +32.486.787.582 Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100304/87bc0379/attachment.html>
It looks good, but I think it''s somethign that should be implemented on a rubyism (irubysm?) like attr_*, so we can call a method "event x" to add the add_x, remove_x and raise_x methods to that class. On Thu, Mar 4, 2010 at 10:39 PM, Ivan Porto Carrero < ivan at whiterabbitconsulting.eu> wrote:> Hi, > > > I''ve created this module to implement INotifyPropertyChanged in classes for > databinding with WPF, but the way I''m handling the event seems a bit > awkward. So I''m just checking if I''m doing it right. The lines of interest > would be around line 76 of the link below > > http://gist.github.com/316765#file_app.rb > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero - Mob: +32.486.787.582 > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > Microsoft IronRuby/C# MVP > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core-- Miguel A. Madero Reyes www.miguelmadero.com (blog) me at miguelmadero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100305/b086a505/attachment.html>
http://gist.github.com/321705 <http://gist.github.com/321705>class Person include ClrEvents include ILotteryWinner attr_event :won_lottery #implements the CLR event WonLottery end --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP On Thu, Mar 4, 2010 at 2:09 PM, Miguel Madero <me at miguelmadero.com> wrote:> It looks good, but I think it''s somethign that should be implemented on a > rubyism (irubysm?) like attr_*, so we can call a method "event x" to add the > add_x, remove_x and raise_x methods to that class. > > > > On Thu, Mar 4, 2010 at 10:39 PM, Ivan Porto Carrero < > ivan at whiterabbitconsulting.eu> wrote: > >> Hi, >> >> >> I''ve created this module to implement INotifyPropertyChanged in classes >> for databinding with WPF, but the way I''m handling the event seems a bit >> awkward. So I''m just checking if I''m doing it right. The lines of interest >> would be around line 76 of the link below >> >> http://gist.github.com/316765#file_app.rb >> --- >> Met vriendelijke groeten - Best regards - Salutations >> Ivan Porto Carrero - Mob: +32.486.787.582 >> Web: http://whiterabbitconsulting.eu - http://flanders.co.nz >> Twitter: http://twitter.com/casualjim >> Author of IronRuby in Action (http://manning.com/carrero) >> Microsoft IronRuby/C# MVP >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com (blog) > me at miguelmadero.com > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100304/9aab3a70/attachment-0001.html>
> return unless @__handlers__ > @__handlers__.each do |ev|* * Look out! Someone snuck in and put __python__ in your nice ruby code! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100305/a3484a25/attachment.html>
Enuce work. Could this become part of IR? On Friday, March 5, 2010, Ivan Porto Carrero <ivan at whiterabbitconsulting.eu> wrote:> http://gist.github.com/321705 > ?<http://gist.github.com/321705>class Person > ?? include ClrEvents?? include ILotteryWinner > > > ?? attr_event :won_lottery ?#implements the CLR event WonLottery > end > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > Microsoft IronRuby/C# MVP > > > On Thu, Mar 4, 2010 at 2:09 PM, Miguel Madero <me at miguelmadero.com> wrote: > > > It looks good, but I think it''s somethign that should be implemented on a rubyism (irubysm?) like attr_*, so we can call a method "event x" to add the add_x, remove_x and raise_x methods to that class. > > > > > > > > On Thu, Mar 4, 2010 at 10:39 PM, Ivan Porto Carrero <ivan at whiterabbitconsulting.eu> wrote: > > Hi, > > > > > I''ve created this module to implement INotifyPropertyChanged in classes for databinding with WPF, but the way I''m handling the event seems a bit awkward. So I''m just checking if I''m doing it right. The lines of interest would be around line 76 of the link below > > > > > > http://gist.github.com/316765#file_app.rb--- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero - Mob: +32.486.787.582 > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz?<http://flanders.co.nz/> > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > Microsoft IronRuby/C# MVP > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com (blog) > me at miguelmadero.com > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > >-- Miguel A. Madero Reyes www.miguelmadero.com (blog) me at miguelmadero.com
Unless Ivan objects, I''m going to add this to a sample library I''m including in rc3. We can discuss moving it to core after post 1.0 plans are final. JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Miguel Madero Sent: Thursday, March 04, 2010 2:05 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Handling CLR events Enuce work. Could this become part of IR? On Friday, March 5, 2010, Ivan Porto Carrero <ivan at whiterabbitconsulting.eu> wrote:> http://gist.github.com/321705 > ?<http://gist.github.com/321705>class Person > ?? include ClrEvents?? include ILotteryWinner > > > ?? attr_event :won_lottery ?#implements the CLR event WonLottery end > --- > Met vriendelijke groeten - Best regards - Salutations Ivan Porto > Carrero > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) Microsoft > IronRuby/C# MVP > > > On Thu, Mar 4, 2010 at 2:09 PM, Miguel Madero <me at miguelmadero.com> wrote: > > > It looks good, but I think it''s somethign that should be implemented on a rubyism (irubysm?) like attr_*, so we can call a method "event x" to add the add_x, remove_x and raise_x methods to that class. > > > > > > > > On Thu, Mar 4, 2010 at 10:39 PM, Ivan Porto Carrero <ivan at whiterabbitconsulting.eu> wrote: > > Hi, > > > > > I''ve created this module to implement INotifyPropertyChanged in > classes for databinding with WPF, but the way I''m handling the event > seems a bit awkward. So I''m just checking if I''m doing it right. The > lines of interest would be around line 76 of the link below > > > > > > http://gist.github.com/316765#file_app.rb--- > Met vriendelijke groeten - Best regards - Salutations Ivan Porto > Carrero - Mob: +32.486.787.582 > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz? > <http://flanders.co.nz/> > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) Microsoft > IronRuby/C# MVP > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > -- > Miguel A. Madero Reyes > www.miguelmadero.com (blog) > me at miguelmadero.com > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > >-- Miguel A. Madero Reyes www.miguelmadero.com (blog) me at miguelmadero.com _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
:) -- Miguel A. Madero Reyes www.miguelmadero.com (blog) me at miguelmadero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100308/9490db9b/attachment.html>