|
|
发表于 2015-8-17 22:29:19
|
显示全部楼层
Sonicthedgehog 发表于 2015-8-17 17:46 
2015-8-17 17:29:17 - Imports System.Windows.Threading
- Imports System.Security.Permissions
- Public Class DispatcherHelper
- <SecurityPermissionAttribute(SecurityAction.Demand, Flags:=SecurityPermissionFlag.UnmanagedCode)>
- Public Shared Sub DoEvents()
- Dim frame As New DispatcherFrame()
- Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, New DispatcherOperationCallback(AddressOf ExitFrames), frame)
- Try
- Dispatcher.PushFrame(frame)
- Catch generatedExceptionName As InvalidOperationException
- End Try
- End Sub
- Private Shared Function ExitFrames(frame As Object) As Object
- DirectCast(frame, DispatcherFrame).Continue = False
- Return Nothing
- End Function
- End Class
复制代码 代码在此~
|
|