From 387f1fe6b9b2376d18821079e3725bedbc52dd66 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:57:13 +0000 Subject: Utilisateur : Fcolin Date : 26/01/06 Heure : 17:33 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 4) --- CSharp/Ivy/IvyPPC/IvyBindingAttribute.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'CSharp') diff --git a/CSharp/Ivy/IvyPPC/IvyBindingAttribute.cs b/CSharp/Ivy/IvyPPC/IvyBindingAttribute.cs index a992192..6969891 100644 --- a/CSharp/Ivy/IvyPPC/IvyBindingAttribute.cs +++ b/CSharp/Ivy/IvyPPC/IvyBindingAttribute.cs @@ -8,15 +8,23 @@ namespace IvyBus public class IvyBindingAttribute : Attribute { string expression; + string[] args; - public string Expression + // translate part of expression to object property + public string GetExpression(object obj) { - get { return expression; } + string[] values = new string[args.Length]; + for (int i = 0; i < args.Length; i++) + { + values[i] = (string)obj.GetType().GetProperty(args[i]).GetValue(obj,null); + } + return string.Format(expression,values); } - public IvyBindingAttribute(string expression) + public IvyBindingAttribute(string expression, params string[] args) { this.expression = expression; + this.args = args; } } } -- cgit v1.1