diff options
author | fcolin | 2007-02-01 10:08:26 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 10:08:26 +0000 |
commit | c82f9a03c0749864f6a4cc5dd09dccb255220ec8 (patch) | |
tree | b398128aa2121d697cb09b9a253c873f5d02f340 /CSharp/Ivy/IvyProbeConsole/IvyProbeConsole.cs | |
parent | 848375328ec9a52a2a5f46b8438011f1a553295b (diff) | |
download | ivy-csharp-c82f9a03c0749864f6a4cc5dd09dccb255220ec8.zip ivy-csharp-c82f9a03c0749864f6a4cc5dd09dccb255220ec8.tar.gz ivy-csharp-c82f9a03c0749864f6a4cc5dd09dccb255220ec8.tar.bz2 ivy-csharp-c82f9a03c0749864f6a4cc5dd09dccb255220ec8.tar.xz |
Utilisateur : Fcolin Date : 23/06/06 Heure : 11:12 Archivé dans $/CSharp/Ivy/IvyProbeConsole Commentaire: (vss 14)
Diffstat (limited to 'CSharp/Ivy/IvyProbeConsole/IvyProbeConsole.cs')
-rw-r--r-- | CSharp/Ivy/IvyProbeConsole/IvyProbeConsole.cs | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/CSharp/Ivy/IvyProbeConsole/IvyProbeConsole.cs b/CSharp/Ivy/IvyProbeConsole/IvyProbeConsole.cs index 6467b11..6c9ce7a 100644 --- a/CSharp/Ivy/IvyProbeConsole/IvyProbeConsole.cs +++ b/CSharp/Ivy/IvyProbeConsole/IvyProbeConsole.cs @@ -14,6 +14,7 @@ namespace IvyProbeConsole using System.Configuration;
using System.Diagnostics;
using IvyBus;
+ using Gnu;
/// <summary> Console implementation of the ivyprobe test program.
/// </summary>
@@ -54,12 +55,12 @@ namespace IvyProbeConsole timestamp = Properties.Settings.Default.timestamp;
debug = Properties.Settings.Default.IvyDebug;
-/*
- Getopt opt = new Getopt("Probe", args, "n:b:dqht");
- int c;
- while ((c = opt.getopt()) != - 1)
- {
- switch (c)
+
+ GetOpt opt = new GetOpt(args, "n:b:dqht");
+ Arg a;
+ while ((a = opt.NextArg()) != null)
+ {
+ switch (a.Flag)
{
case 'd':
//UPGRADE_ISSUE: Method 'java.lang.System.getProperties' was not converted. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1000_javalangSystemgetProperties"'
@@ -68,10 +69,10 @@ namespace IvyProbeConsole break;
case 'b':
- domain = opt.Optarg; break;
+ domain = a.Parameter; break;
case 'n':
- name = opt.Optarg; break;
+ name = a.Parameter; break;
case 'q':
quiet = true; break;
@@ -86,18 +87,18 @@ namespace IvyProbeConsole }
}
-*/
+
IvyProbeConsole p = new IvyProbeConsole(System.Console.In, timestamp, quiet, debug );
p.ExitOnDie = true;
Ivy bus = new Ivy(name, name + " ready");
-/* for (int i = opt.Optind; i < args.Length; i++)
+ foreach(string ex in opt.Extras)
{
if (!quiet)
- System.Console.Out.WriteLine("you want to subscribe to " + args[i]);
- bus.bindMsg(args[i], p);
+ System.Console.Out.WriteLine("you want to subscribe to " + ex);
+ bus.BindMsg(ex, p.receive);
}
-*/
+
if (!quiet)
System.Console.Out.WriteLine(Ivy.Domains(domain));
@@ -274,8 +275,13 @@ namespace IvyProbeConsole private void receive(object sender, IvyMessageEventArgs e)
{
- String s = e.Client.ApplicationName + " sent" + e.Arguments.ToString();
- println(s);
+ String s = e.Client.ApplicationName + " sent ";
+ // Copy the collection to a new array starting at index 0.
+ String[] args = new String[e.Arguments.Count];
+ e.Arguments.CopyTo(args, 0);
+
+ s += string.Join(",", args);
+ println(s);
}
[Conditional("DEBUG")]
private void traceDebug(String s)
|