如何从 IronRuby 类引发 .Net 事件?
我试图弄清楚如何在 ruby 类中实现事件。具体来说,我试图让我的类实现一个包含事件(PropertyChanged)的接口(INotifyPropertyChanged)。我可以创建我的 add_PropertyChanged 和 remove_PropertyChanged 方法...但是然后呢?
这是我的班级到目前为止的样子:
class TestClass
include System::ComponentModel::INotifyPropertyChanged
def add_PropertyChanged(handler)
end
def remove_PropertyChanged(handler)
end
end
I'm trying to figure out how to implement an event in a ruby class. Specifically, I am trying to make my class implement an interface (INotifyPropertyChanged) that includes an event (PropertyChanged). I can create my add_PropertyChanged and remove_PropertyChanged methods... but then what?
This is what my class looks like so far:
class TestClass
include System::ComponentModel::INotifyPropertyChanged
def add_PropertyChanged(handler)
end
def remove_PropertyChanged(handler)
end
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我明白了。操作方法如下:
OK, I figured it out. Here is how you do it: