summaryrefslogtreecommitdiff
path: root/CSharp
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:55:00 +0000
committerfcolin2007-02-01 09:55:00 +0000
commit7327a481cc6956a0cbcb26d394ae32c4494f8500 (patch)
treee64108228a2b9f8d0b390a7831328e1edd7f77fc /CSharp
parentf019cbdf690cc815e91968494db22dd495759f6a (diff)
downloadivy-csharp-7327a481cc6956a0cbcb26d394ae32c4494f8500.zip
ivy-csharp-7327a481cc6956a0cbcb26d394ae32c4494f8500.tar.gz
ivy-csharp-7327a481cc6956a0cbcb26d394ae32c4494f8500.tar.bz2
ivy-csharp-7327a481cc6956a0cbcb26d394ae32c4494f8500.tar.xz
Utilisateur : Fcolin Date : 12/01/06 Heure : 9:46 Archivé dans $/CSharp/Ivy Commentaire: (vss 32)
Diffstat (limited to 'CSharp')
-rw-r--r--CSharp/Ivy/IvyPPC/Ivy.cs58
1 files changed, 34 insertions, 24 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs
index b1b9cdd..7f4ae81 100644
--- a/CSharp/Ivy/IvyPPC/Ivy.cs
+++ b/CSharp/Ivy/IvyPPC/Ivy.cs
@@ -249,10 +249,7 @@ namespace IvyBus
/// </param>
public void start(string domainbus)
{
- if (domainbus == null)
- domainbus = Environment.GetEnvironmentVariable("IVYBUS");
- if (domainbus == null)
- domainbus = DEFAULT_DOMAIN;
+ domainbus = getDomain(domainbus);
try
{
IPAddress localaddr = Dns.Resolve(Dns.GetHostName()).AddressList[0];
@@ -484,7 +481,7 @@ namespace IvyBus
{
foreach (IvyClient c in clients )
{
- c.stream.TokenAddRegexp(newbind);
+ c.stream.TokenAddBinding(newbind);
}
}
return newbind.key;
@@ -572,7 +569,7 @@ namespace IvyBus
{
foreach (IvyClient c in clients )
{
- c.stream.TokenAddBinding(newbind.key, newbind.expression);
+ c.stream.TokenAddBinding(newbind);
}
}
return newbind.key;
@@ -591,11 +588,36 @@ namespace IvyBus
v[i].stream.TokenPing(message);
return v.Count;
}
+// internal object FireEvents(Delegate eventDelegate, params object[] args)
+// {
+// if (eventDelegate != null)
+// {
+// if (syncControl != null
+//#if (!PocketPC )
+// && syncControl.Created
+//#endif
+// )
+// return syncControl.Invoke(eventDelegate, args);
+// else return eventDelegate(args);
+// }
+// return null;
+// }
+ internal void FireCallback(IvyClient client, int key, string[] arg)
+ {
+ ApplicationBinding bind = bindings[key];
+ if (bind.callback == null)
+ {
+ throw new IvyException("(callCallback) Not regexp matching id " + key);
+ }
+ if (syncControl != null && syncControl.Created)
+ syncControl.Invoke(bind.callback, new object[] { client, arg });
+ else bind.callback(client, arg);
+ }
internal void FireDirectMessage(IvyClient app, int id, string arg)
{
if ( directMessageReceived != null )
{
- if ( syncControl != null )
+ if (syncControl != null && syncControl.Created)
syncControl.Invoke( directMessageReceived, new object[]{app,id,arg});
else directMessageReceived( app, id, arg);
}
@@ -604,7 +626,7 @@ namespace IvyBus
{
if ( clientConnected != null )
{
- if ( syncControl != null )
+ if (syncControl != null && syncControl.Created)
syncControl.Invoke( clientConnected, new object[]{app});
else clientConnected( app);
}
@@ -613,7 +635,7 @@ namespace IvyBus
{
if ( clientDisconnected != null )
{
- if ( syncControl != null )
+ if ( syncControl != null && syncControl.Created )
syncControl.Invoke( clientDisconnected, new object[]{app});
else clientDisconnected( app);
}
@@ -622,7 +644,7 @@ namespace IvyBus
{
if ( addBinding != null )
{
- if ( syncControl != null )
+ if (syncControl != null && syncControl.Created)
syncControl.Invoke( addBinding, new object[]{app,regexp});
else addBinding( app,regexp);
}
@@ -631,7 +653,7 @@ namespace IvyBus
{
if ( removeBinding != null )
{
- if ( syncControl != null )
+ if (syncControl != null && syncControl.Created)
syncControl.Invoke( removeBinding, new object[]{app,regexp});
else removeBinding( app,regexp);
}
@@ -640,7 +662,7 @@ namespace IvyBus
{
if ( dieReceived != null )
{
- if ( syncControl != null )
+ if (syncControl != null && syncControl.Created)
syncControl.Invoke( dieReceived, new object[]{app,id,arg});
else return dieReceived( app, id, arg);
}
@@ -692,18 +714,6 @@ namespace IvyBus
}
traceDebug(ClientNames);
}
-
- internal void FireCallback(IvyClient client, int key, string[] arg)
- {
- ApplicationBinding bind = bindings[key];
- if (bind.callback == null)
- {
- throw new IvyException("(callCallback) Not regexp matching id " + key);
- }
- if ( syncControl != null )
- syncControl.Invoke(bind.callback, new object[] { client, arg });
- else bind.callback(client, arg);
- }
public static string getDomain(string domainbus)