From 760130cd630a7bc2c2498f3ed3b38a8ed901a1dc Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:57:03 +0000 Subject: Utilisateur : Fcolin Date : 23/06/06 Heure : 11:12 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 10) --- CSharp/Ivy/IvyPPC/IvyBinding.cs | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/CSharp/Ivy/IvyPPC/IvyBinding.cs b/CSharp/Ivy/IvyPPC/IvyBinding.cs index 6dcd544..4e48054 100644 --- a/CSharp/Ivy/IvyPPC/IvyBinding.cs +++ b/CSharp/Ivy/IvyPPC/IvyBinding.cs @@ -6,21 +6,35 @@ using System.Diagnostics; namespace IvyBus { + /* This is the Client side of binding storage */ + /* association of a generated Key and the expression and a compiled Expression matching */ + /* this is RECEIVED from other client */ + /// /// Description résumée de IvyBinding. /// internal abstract class IvyBindingBase { - internal ushort key; - internal string expression; + private ushort key; + + internal ushort Key + { + get { return key; } + } + protected string expression; + + internal string Expression + { + get { return expression; } + } - public IvyBindingBase(ushort id, string exp) + internal IvyBindingBase(ushort id, string exp) { key = id; expression = exp; } - public abstract string[] Match(string message); + internal abstract string[] Match(string message); } internal class IvyBindingRegexp : IvyBindingBase @@ -30,9 +44,10 @@ namespace IvyBus public IvyBindingRegexp(ushort id, string exp) : base(id, exp) { - regexp = new Regex(expression,RegexOptions.Compiled|RegexOptions.IgnoreCase); + regexp = new Regex(expression, /* RegexOptions.Compiled | */RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + //regexp.Match("###"); // for really compile the expression really slow on 3000 expression } - public override string[] Match(string message) + internal override string[] Match(string message) { string[] args = null; // use of regexp to extract info @@ -56,7 +71,7 @@ namespace IvyBus static string msgtag; // send message name static StringDictionary args_values; // send message args[name]=value - public IvyBindingSimple(ushort id, string exp) + internal IvyBindingSimple(ushort id, string exp) : base(id, exp) { string[] expr = expression.Split( ' ' ); @@ -65,7 +80,7 @@ namespace IvyBus for ( int i = 1; i < expr.Length; i++ ) msgargs[i-1] = expr[i]; } - static public void Prepare( string message ) + static internal void Prepare(string message) { string[] msg = message.Split(' '); msgtag = msg[0]; @@ -82,7 +97,7 @@ namespace IvyBus } } - public override string[] Match(string message) + internal override string[] Match(string message) { // the message is already parsed by prepare // -- cgit v1.1