summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CSharp/Ivy/IvyProbe/IvyProbe.cs31
1 files changed, 12 insertions, 19 deletions
diff --git a/CSharp/Ivy/IvyProbe/IvyProbe.cs b/CSharp/Ivy/IvyProbe/IvyProbe.cs
index be58417..12ef895 100644
--- a/CSharp/Ivy/IvyProbe/IvyProbe.cs
+++ b/CSharp/Ivy/IvyProbe/IvyProbe.cs
@@ -6,6 +6,7 @@ namespace IvyProbe
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
+ using System.Reflection;
partial class IvyProbe : System.Windows.Forms.Form
@@ -19,16 +20,6 @@ namespace IvyProbe
// Requis pour la prise en charge du Concepteur Windows Forms
//
InitializeComponent();
-
- //bus = new Ivy("IvyProbe_C#", "IvyProbe_C# ready", this);
- //bus.Debug = true;
- //bus.clientConnected += new Ivy.ClientConnectedHandler( connect );
- //bus.clientDisconnected += new Ivy.ClientDisconnectedHandler( disconnect );
- //bus.addBinding +=new IvyBus.Ivy.ClientAddBindingHandler(bus_addBinding);
- //bus.removeBinding += new IvyBus.Ivy.ClientRemoveBindingHandler(bus_removeBinding);
- //bus.dieReceived += new Ivy.DieHandler( die );
- //bus.directMessageReceived += new Ivy.DirectMessageHandler( directMessage );
- //bus.start(null);
}
@@ -40,6 +31,12 @@ namespace IvyProbe
//bus.directMessageReceived -= new Ivy.DirectMessageHandler( directMessage );
//bus.stop();
}
+ private void append(System.String s)
+ {
+ // je mettrais bien la date, aussi.
+ ta.AppendText(s + "\r\n");
+ }
+
private void connect(IvyClient client)
{
append(client.ApplicationName + " connected from "+client.RemoteAddress);
@@ -64,7 +61,7 @@ namespace IvyProbe
// ajoute la nouvelle regex
string regexp = tbRegexp.Text;
regexp.Trim();
- int regexp_id = bus.ivy.bindMsg(regexp, new Ivy.MessageHandler(receive));
+ int regexp_id = bus.bindMsg(regexp, new Ivy.MessageHandler(receive));
tbRegexp.Text = "";
append( "bind("+regexp_id+") ->"+regexp);
}
@@ -73,10 +70,11 @@ namespace IvyProbe
// ajoute la nouvelle regex
string expression = tbRegexp.Text;
expression.Trim();
- int regexp_id = bus.ivy.bindSimpleMsg(expression, new Ivy.MessageHandler(receive));
+ int regexp_id = bus.bindSimpleMsg(expression, new Ivy.MessageHandler(receive));
tbRegexp.Text = "";
append( "bind("+regexp_id+") ->"+expression);
}
+ [IvyBinding("(.*)")]
private void receive(IvyClient client, string[] args)
{
string receive_str = "client " + client.ApplicationName + " envoie: [";
@@ -88,18 +86,13 @@ namespace IvyProbe
receive_str += "]";
append(receive_str);
}
- private void append(System.String s)
- {
- // je mettrais bien la date, aussi.
- ta.AppendText(s+"\r\n");
- }
public void SendCB(System.Object event_sender, System.EventArgs e)
{
int count;
System.String tosend = tbMsg.Text;
tbMsg.Text = "";
- count = bus.ivy.sendMsg(tosend);
+ count = bus.sendMsg(tosend);
append("Sending '" + tosend + "' count " + count);
}
@@ -129,7 +122,7 @@ namespace IvyProbe
{
// enleve la regex
string regexp = tbRegexp.Text;
- bool removed = bus.ivy.unBindMsg( regexp );
+ bool removed = bus.unBindMsg( regexp );
if ( removed )
{
append( "unbind("+regexp+")");