summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyProbe
diff options
context:
space:
mode:
authorfcolin2007-02-01 10:06:11 +0000
committerfcolin2007-02-01 10:06:11 +0000
commit124432b91fbb63285318e6786cead5d8ee0dbea7 (patch)
treef7d1b1f3f115ed4b1c68a5d20b28b3ca6a1cdc2c /CSharp/Ivy/IvyProbe
parentf0515dd1ffe46a6cafa8fc96601f494e5d4170ec (diff)
downloadivy-csharp-124432b91fbb63285318e6786cead5d8ee0dbea7.zip
ivy-csharp-124432b91fbb63285318e6786cead5d8ee0dbea7.tar.gz
ivy-csharp-124432b91fbb63285318e6786cead5d8ee0dbea7.tar.bz2
ivy-csharp-124432b91fbb63285318e6786cead5d8ee0dbea7.tar.xz
Utilisateur : Fcolin Date : 23/01/06 Heure : 18:09 Archivé dans $/CSharp/Ivy/IvyProbe Commentaire: (vss 11)
Diffstat (limited to 'CSharp/Ivy/IvyProbe')
-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+")");