summaryrefslogtreecommitdiff
path: root/cs/demo/Ice/async/Client.cs
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2014-07-11 08:59:44 -0230
committerMatthew Newhook <matthew@zeroc.com>2014-07-11 08:59:44 -0230
commitd00b3fe3835eda362f259bef48775b09846d1546 (patch)
tree18cc9897797574e662b23d4119ab04f11f9202be /cs/demo/Ice/async/Client.cs
parentFixed ICE-5379, Object Adapter should reject null servant, in C++, Java, C# a... (diff)
downloadice-d00b3fe3835eda362f259bef48775b09846d1546.tar.bz2
ice-d00b3fe3835eda362f259bef48775b09846d1546.tar.xz
ice-d00b3fe3835eda362f259bef48775b09846d1546.zip
ICE-5513 - Fix the C# demos to use lambda expressions
- Simplified and refactored some C# tests to use lambdas. - Changed the operations and ami test to test both lambda and delegate based callbacks. - In cs/test/Ice/timeout changed TimeoutException to InvocationTimeoutException for the invocation timeout test.
Diffstat (limited to 'cs/demo/Ice/async/Client.cs')
-rw-r--r--cs/demo/Ice/async/Client.cs32
1 files changed, 14 insertions, 18 deletions
diff --git a/cs/demo/Ice/async/Client.cs b/cs/demo/Ice/async/Client.cs
index a1440efa3e4..6a224638e5b 100644
--- a/cs/demo/Ice/async/Client.cs
+++ b/cs/demo/Ice/async/Client.cs
@@ -21,23 +21,6 @@ public class Client
{
public class App : Ice.Application
{
- public void success()
- {
- }
-
- public void exception(Ice.Exception ex)
- {
- if(ex is RequestCanceledException)
- {
- Console.Error.WriteLine("RequestCanceledException");
- }
- else
- {
- Console.Error.WriteLine("sayHello AMI call failed:");
- Console.Error.WriteLine(ex);
- }
- }
-
private static void menu()
{
Console.Out.WriteLine(
@@ -84,7 +67,20 @@ public class Client
}
else if(line.Equals("d"))
{
- hello.begin_sayHello(5000).whenCompleted(success, exception);
+ hello.begin_sayHello(5000).whenCompleted(
+ () => { },
+ (Ice.Exception ex) =>
+ {
+ if(ex is RequestCanceledException)
+ {
+ Console.Error.WriteLine("RequestCanceledException");
+ }
+ else
+ {
+ Console.Error.WriteLine("sayHello AMI call failed:");
+ Console.Error.WriteLine(ex);
+ }
+ });
}
else if(line.Equals("s"))
{