Commit 629ba957 authored by Honfika's avatar Honfika

async invoke

parent 6f64f91a
...@@ -88,7 +88,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf ...@@ -88,7 +88,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
private async Task ProxyServer_TunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e) private async Task ProxyServer_TunnelConnectRequest(object sender, TunnelConnectSessionEventArgs e)
{ {
Dispatcher.Invoke(() => await Dispatcher.InvokeAsync(() =>
{ {
AddSession(e); AddSession(e);
}); });
...@@ -96,7 +96,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf ...@@ -96,7 +96,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
private async Task ProxyServer_TunnelConnectResponse(object sender, SessionEventArgs e) private async Task ProxyServer_TunnelConnectResponse(object sender, SessionEventArgs e)
{ {
Dispatcher.Invoke(() => await Dispatcher.InvokeAsync(() =>
{ {
SessionListItem item; SessionListItem item;
if (sessionDictionary.TryGetValue(e, out item)) if (sessionDictionary.TryGetValue(e, out item))
...@@ -113,7 +113,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf ...@@ -113,7 +113,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
private async Task ProxyServer_BeforeRequest(object sender, SessionEventArgs e) private async Task ProxyServer_BeforeRequest(object sender, SessionEventArgs e)
{ {
SessionListItem item = null; SessionListItem item = null;
Dispatcher.Invoke(() => await Dispatcher.InvokeAsync(() =>
{ {
item = AddSession(e); item = AddSession(e);
}); });
...@@ -127,7 +127,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf ...@@ -127,7 +127,7 @@ namespace Titanium.Web.Proxy.Examples.Wpf
private async Task ProxyServer_BeforeResponse(object sender, SessionEventArgs e) private async Task ProxyServer_BeforeResponse(object sender, SessionEventArgs e)
{ {
SessionListItem item = null; SessionListItem item = null;
Dispatcher.Invoke(() => await Dispatcher.InvokeAsync(() =>
{ {
SessionListItem item2; SessionListItem item2;
if (sessionDictionary.TryGetValue(e, out item2)) if (sessionDictionary.TryGetValue(e, out item2))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment