summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:57:13 +0000
committerfcolin2007-02-01 09:57:13 +0000
commit387f1fe6b9b2376d18821079e3725bedbc52dd66 (patch)
treeaabea8edcc8fc5f76af1a86b932d53bb4d9e7eb7 /CSharp/Ivy/IvyPPC
parente42541515b560864451408de06a5235afbae83f3 (diff)
downloadivy-csharp-387f1fe6b9b2376d18821079e3725bedbc52dd66.zip
ivy-csharp-387f1fe6b9b2376d18821079e3725bedbc52dd66.tar.gz
ivy-csharp-387f1fe6b9b2376d18821079e3725bedbc52dd66.tar.bz2
ivy-csharp-387f1fe6b9b2376d18821079e3725bedbc52dd66.tar.xz
Utilisateur : Fcolin Date : 26/01/06 Heure : 17:33 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 4)
Diffstat (limited to 'CSharp/Ivy/IvyPPC')
-rw-r--r--CSharp/Ivy/IvyPPC/IvyBindingAttribute.cs14
1 files changed, 11 insertions, 3 deletions
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;
}
}
}