aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/CompilerServices/Bindings.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/CompilerServices/Bindings.cs')
-rw-r--r--src/CompilerServices/Bindings.cs27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/CompilerServices/Bindings.cs b/src/CompilerServices/Bindings.cs
index 8ece856c..64f412f6 100644
--- a/src/CompilerServices/Bindings.cs
+++ b/src/CompilerServices/Bindings.cs
@@ -41,6 +41,11 @@ namespace Crow
public string DynMethodId {
get { return dynMethodId; }
}
+ public Type SourceType {
+ get { return Source == null ? null
+ : Source.Instance == null ? null
+ : Source.Instance.GetType();}
+ }
public bool Resolved {
get { return resolved; }
@@ -123,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 {
@@ -148,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;
}
@@ -164,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)
@@ -182,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)) {