aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/CompilerServices
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-08-10 07:13:14 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-08-10 07:13:40 +0200
commit1b2e2794fc8c4c8c20ff50fd7fbe842908912d23 (patch)
treee84e01c98b958e9d93214757543639110b07ae4f /src/CompilerServices
parent5a03df5faeda15e2d99c4c656eb62ed21817fdf6 (diff)
parent69c470239bfbab11192f3699f29b5352d74d3630 (diff)
ItemTemplate instantiator, basic listbox ok
Diffstat (limited to 'src/CompilerServices')
-rw-r--r--src/CompilerServices/Bindings.cs22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/CompilerServices/Bindings.cs b/src/CompilerServices/Bindings.cs
index 953f1492..64f412f6 100644
--- a/src/CompilerServices/Bindings.cs
+++ b/src/CompilerServices/Bindings.cs
@@ -128,10 +128,12 @@ namespace Crow
//datasource binding
object dataSource = (Source.Instance as GraphicObject).DataSource;
if (dataSource == null) {
+ #if DEBUG_BINDING
Debug.WriteLine ("\tDataSource is null => " + this.ToString());
+ #endif
return false;
}
-
+
Target = new MemberReference (dataSource);
memberName = bindingExp [0];
} else {
@@ -153,7 +155,7 @@ namespace Crow
while (ptr < bindingExp.Length - 1) {
if (tmpTarget == null) {
#if DEBUG_BINDING
- Debug.WriteLine ("\tERROR: target not found => " + this.ToString());
+ Debug.WriteLine ("\tTarget not found => " + this.ToString());
#endif
return false;
}
@@ -169,14 +171,12 @@ namespace Crow
}
if (tmpTarget == null) {
-#if DEBUG_BINDING
- Debug.WriteLine ("\tERROR: Binding Target not found => " + this.ToString());
-#endif
+ #if DEBUG_BINDING
+ Debug.WriteLine ("\tBinding Target not found => " + this.ToString());
+ #endif
return false;
}
- Target = new MemberReference (tmpTarget);
-
string [] bindTrg = bindingExp [ptr].Split ('.');
if (bindTrg.Length == 1)
@@ -187,6 +187,14 @@ namespace Crow
} else
throw new Exception ("Syntax error in binding, expected 'go dot member'");
+ if (tmpTarget == null) {
+ #if DEBUG_BINDING
+ Debug.WriteLine ("\tBinding Target not found => " + this.ToString());
+ #endif
+ return false;
+ }
+
+ Target = new MemberReference (tmpTarget);
}
if (Target.TryFindMember (memberName)) {