summaryrefslogtreecommitdiff
path: root/cs/demo/Ice/wpf/HelloWindow.xaml.cs
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-12-03 17:09:19 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-12-03 17:09:19 +0100
commitf24200b2f2ce752ac2d35751d6d615b72642bbaf (patch)
treec1d95a4b55725bac4c1115e9b76e9718f1396ad7 /cs/demo/Ice/wpf/HelloWindow.xaml.cs
parentAdded back IceHome setting for source tree compiles (diff)
downloadice-f24200b2f2ce752ac2d35751d6d615b72642bbaf.tar.bz2
ice-f24200b2f2ce752ac2d35751d6d615b72642bbaf.tar.xz
ice-f24200b2f2ce752ac2d35751d6d615b72642bbaf.zip
Fixed demos to use Ice.Dispatcher
Diffstat (limited to 'cs/demo/Ice/wpf/HelloWindow.xaml.cs')
-rw-r--r--cs/demo/Ice/wpf/HelloWindow.xaml.cs51
1 files changed, 17 insertions, 34 deletions
diff --git a/cs/demo/Ice/wpf/HelloWindow.xaml.cs b/cs/demo/Ice/wpf/HelloWindow.xaml.cs
index 5a79a9dfb5a..c48a1d94eb6 100644
--- a/cs/demo/Ice/wpf/HelloWindow.xaml.cs
+++ b/cs/demo/Ice/wpf/HelloWindow.xaml.cs
@@ -52,6 +52,10 @@ namespace Ice.wpf.client
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = Ice.Util.createProperties();
initData.properties.load("config.client");
+ initData.dispatcher = delegate(System.Action action, Ice.Connection connection)
+ {
+ Dispatcher.BeginInvoke(DispatcherPriority.Normal, action);
+ };
_communicator = Ice.Util.initialize(initData);
}
catch(Ice.LocalException ex)
@@ -129,10 +133,7 @@ namespace Ice.wpf.client
{
Debug.Assert(!_response);
_response = true;
- _window.Dispatcher.BeginInvoke(DispatcherPriority.Normal,(Action)delegate()
- {
- _window.status.Content = "Ready";
- });
+ _window.status.Content = "Ready";
}
}
@@ -142,10 +143,7 @@ namespace Ice.wpf.client
{
Debug.Assert(!_response);
_response = true;
- _window.Dispatcher.BeginInvoke(DispatcherPriority.Normal,(Action)delegate()
- {
- _window.handleException(ex);
- });
+ _window.handleException(ex);
}
}
@@ -157,17 +155,14 @@ namespace Ice.wpf.client
{
return;
}
- _window.Dispatcher.BeginInvoke(DispatcherPriority.Normal,(Action)delegate()
+ if(_window.deliveryMode.Text.Equals(TWOWAY) || _window.deliveryMode.Text.Equals(TWOWAY_SECURE))
{
- if(_window.deliveryMode.Text.Equals(TWOWAY) || _window.deliveryMode.Text.Equals(TWOWAY_SECURE))
- {
- _window.status.Content = "Waiting for response";
- }
- else
- {
- _window.status.Content = "Ready";
- }
- });
+ _window.status.Content = "Waiting for response";
+ }
+ else
+ {
+ _window.status.Content = "Ready";
+ }
}
}
@@ -208,10 +203,7 @@ namespace Ice.wpf.client
private void handleException(Exception ex)
{
- this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,(Action)delegate()
- {
- status.Content = ex.GetType();
- });
+ status.Content = ex.GetType();
}
private void shutdown_Click(object sender, RoutedEventArgs e)
@@ -232,17 +224,11 @@ namespace Ice.wpf.client
status.Content = "Sending request";
result.whenCompleted(delegate()
{
- Dispatcher.BeginInvoke(DispatcherPriority.Normal,(Action)delegate()
- {
- status.Content = "Ready";
- });
+ status.Content = "Ready";
},
delegate(Exception ex)
{
- Dispatcher.BeginInvoke(DispatcherPriority.Normal,(Action)delegate()
- {
- handleException(ex);
- });
+ handleException(ex);
});
}
else
@@ -268,10 +254,7 @@ namespace Ice.wpf.client
}
catch(Ice.LocalException ex)
{
- this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,(Action)delegate()
- {
- handleException(ex);
- });
+ handleException(ex);
}
})).Start();
flush.IsEnabled = false;