summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC/Ivy.cs
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:55:54 +0000
committerfcolin2007-02-01 09:55:54 +0000
commit2f34e3990b770a52cb6daa3e234d9334c89d82a3 (patch)
treeaa4ece61605baa9f49095a7e23e30a9c6682bafa /CSharp/Ivy/IvyPPC/Ivy.cs
parentffe6d1914d0f00cb7d33ea33e22afe4fa3275cd6 (diff)
downloadivy-csharp-2f34e3990b770a52cb6daa3e234d9334c89d82a3.zip
ivy-csharp-2f34e3990b770a52cb6daa3e234d9334c89d82a3.tar.gz
ivy-csharp-2f34e3990b770a52cb6daa3e234d9334c89d82a3.tar.bz2
ivy-csharp-2f34e3990b770a52cb6daa3e234d9334c89d82a3.tar.xz
Utilisateur : Fcolin Date : 10/02/06 Heure : 15:33 Archivé dans $/CSharp/Ivy/Ivy Commentaire: ajout evenement ErrorMessage (vss 59)
Diffstat (limited to 'CSharp/Ivy/IvyPPC/Ivy.cs')
-rw-r--r--CSharp/Ivy/IvyPPC/Ivy.cs28
1 files changed, 24 insertions, 4 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs
index 82979c0..5d2a8b0 100644
--- a/CSharp/Ivy/IvyPPC/Ivy.cs
+++ b/CSharp/Ivy/IvyPPC/Ivy.cs
@@ -44,6 +44,7 @@ namespace IvyBus
public delegate ApplicationExit DieHandler(IvyClient app, int id, string arg);
public delegate void ClientAddBindingHandler(IvyClient app, string arg);
public delegate void ClientRemoveBindingHandler(IvyClient app, string arg);
+ public delegate void ErrorMessageHandler(IvyClient app, int id, string arg);
public delegate void MessageHandler(IvyClient app, string[] args);
@@ -65,6 +66,8 @@ namespace IvyBus
public event ClientAddBindingHandler BindingAdd;
/// <summary>fires when a client receive a remove binding from another client</summary>
public event ClientRemoveBindingHandler BindingRemove;
+ /// <summary>fires when a client receive a remove binding from another client</summary>
+ public event ErrorMessageHandler ErrorMessage;
#if (!PocketPC)
[Category("Ivy")]
@@ -774,6 +777,7 @@ namespace IvyBus
if (syncControl != null
#if (!PocketPC )
&& syncControl.Created
+ && ! syncControl.IsDisposed
#endif
)
return true;
@@ -802,9 +806,16 @@ namespace IvyBus
{
if (ClientDisconnected != null)
{
- if (IsSynchronous())
- syncControl.Invoke(ClientDisconnected, new object[] { app });
- else ClientDisconnected(app);
+ try
+ {
+ if (IsSynchronous())
+ syncControl.Invoke(ClientDisconnected, new object[] { app });
+ else ClientDisconnected(app);
+ }
+ catch (ObjectDisposedException ie)
+ {
+ // protect terminaison
+ }
}
}
internal void FireClientAddBinding(IvyClient app, string regexp)
@@ -835,7 +846,15 @@ namespace IvyBus
}
return ApplicationExit.FORCE_EXIT;
}
-
+ internal void FireError(IvyClient client, int id, string arg)
+ {
+ if (ErrorMessage != null)
+ {
+ if (IsSynchronous())
+ syncControl.Invoke(ErrorMessage, new object[] { client, id, arg });
+ else ErrorMessage(client, id, arg);
+ }
+ }
/*
* removes a client from the list
@@ -893,6 +912,7 @@ namespace IvyBus
syncControl.Invoke(bind.callback, new object[] { client, arg });
else bind.callback(client, arg);
}
+
public static IPAddress getLocalIP()
{
IPAddress returnaddr = null;