vb.net 实现 IAsyncResult.AsyncState
我可以在 C# 中轻松完成此操作...但我需要 VB.Net 中的同等功能。我需要能够在 VB.Net 中实现各种 IAsyncResult 属性。
在 C#
工作得像冠军...
public object AsyncState { get; set; }
在 VB.NET - 这失败了
这个失败是因为你无法重载 VB.Net 中的属性
Public ReadOnly Property AsyncState() As Object Implements IAsyncResult.AsyncState
Get
'... the GET's code goes here ...
End Get
End Property
Public WriteOnly Property AsyncState() As Object
Set(ByVal value As Object)
'... the SET's code goes here ...
End Set
End Property
在 VB.NET -这两个都失败
了这不符合“必须实现 IAsyncResult”的要求
Public AsyncState As Object
Public AsyncState As Object Implements IAsyncResult.AsyncState
I can easily do this in C#...but I need the equivalent in VB.Net. I need to be able to implement various IAsyncResult properties in VB.Net.
IN C#
Works like a champ...
public object AsyncState { get; set; }
IN VB.NET - THIS FAILS
This fails because you cannot overload a property in VB.Net
Public ReadOnly Property AsyncState() As Object Implements IAsyncResult.AsyncState
Get
'... the GET's code goes here ...
End Get
End Property
Public WriteOnly Property AsyncState() As Object
Set(ByVal value As Object)
'... the SET's code goes here ...
End Set
End Property
IN VB.NET - BOTH THESE FAIL
This fails the "must implement IAsyncResult" requirement
Public AsyncState As Object
Public AsyncState As Object Implements IAsyncResult.AsyncState
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这成功了......
This did the trick...