summaryrefslogtreecommitdiff
path: root/CSharp
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:45:47 +0000
committerfcolin2007-02-01 09:45:47 +0000
commitf4aa805c42df7667d580c198b91e33681c4b9089 (patch)
tree577615262fd0fbf40868105aad57155df4750c0e /CSharp
parent0a4f95c8e52ab960b12b7ade2d9697b8c12c835b (diff)
downloadivy-csharp-f4aa805c42df7667d580c198b91e33681c4b9089.zip
ivy-csharp-f4aa805c42df7667d580c198b91e33681c4b9089.tar.gz
ivy-csharp-f4aa805c42df7667d580c198b91e33681c4b9089.tar.bz2
ivy-csharp-f4aa805c42df7667d580c198b91e33681c4b9089.tar.xz
Utilisateur : Fcolin Date : 26/01/06 Heure : 17:33 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 4)
Diffstat (limited to 'CSharp')
-rw-r--r--CSharp/Ivy/Ivy/IvyBindingAttribute.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/CSharp/Ivy/Ivy/IvyBindingAttribute.cs b/CSharp/Ivy/Ivy/IvyBindingAttribute.cs
index a992192..6969891 100644
--- a/CSharp/Ivy/Ivy/IvyBindingAttribute.cs
+++ b/CSharp/Ivy/Ivy/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;
}
}
}