aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GraphicObject.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-05-18 18:13:48 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-05-18 18:13:48 +0200
commitfd19c1fd6960faf9b7131a4dfade4bba95abcf81 (patch)
tree59653a3db212e877aa125884e85e11333bc474cd /src/GraphicObjects/GraphicObject.cs
parent2a48f25993b48535eb84f0e83e4dd7c064ed6e49 (diff)
Simple bindings
demonstration in testFps
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
-rw-r--r--src/GraphicObjects/GraphicObject.cs20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index a7b9e93e..683e88f3 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -108,6 +108,7 @@ namespace go
public event EventHandler<KeyboardKeyEventArgs> KeyUp;
public event EventHandler Focused;
public event EventHandler Unfocused;
+
#endregion
#region public properties
@@ -641,11 +642,11 @@ namespace go
if (string.IsNullOrEmpty (handler))
continue;
- Interface.EventsToResolve.Add(new EventSource
+ Interface.EventsToResolve.Add(new DynAttribute
{
Source = this,
- Handler = handler,
- EventName = ei.Name
+ Value = handler,
+ MemberName = ei.Name
});
}
foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {
@@ -713,6 +714,19 @@ namespace go
else
pi.SetValue (this, defaultValue, null);
} else {
+ if (v.StartsWith("{")) {
+ //binding
+ if (!v.EndsWith("}"))
+ throw new Exception (string.Format("GOML:Malformed binding: {0}", v));
+
+ string strBinding = v.Substring (1, v.Length - 2);
+ Interface.Bindings.Add (new DynAttribute () {
+ Source = this,
+ MemberName = name,
+ Value = strBinding
+ });
+ }
+
if (pi.PropertyType == typeof(string)) {
pi.SetValue (this, v, null);
continue;