aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-03-18 18:43:48 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-03-18 18:43:48 +0200
commit96352ac46ccb871783c63fd98efe034091214b7e (patch)
treec8e0893784457974a8e005d27573e0c3b285f2d9 /Software/Visual_Studio
parent4f4b5f052200fde6ccc6aa06094904cf9bf3106b (diff)
downloadTango-96352ac46ccb871783c63fd98efe034091214b7e.tar.gz
Tango-96352ac46ccb871783c63fd98efe034091214b7e.zip
Make android DAL observable !
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml6
-rw-r--r--Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs2
2 files changed, 6 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml
index aeba15b12..87c82395b 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFileJava.cshtml
@@ -7,6 +7,8 @@ import com.raizlabs.android.dbflow.annotation.Table;
import org.joda.time.DateTime;
import com.twine.tango.dal.Entity;
import com.twine.tango.dal.TangoDB;
+import android.databinding.Bindable;
+import com.twine.tango.dal.BR;
@@Table(name = "@(Model.TableName)", database = TangoDB.class)
@@ -40,7 +42,8 @@ import com.twine.tango.dal.TangoDB;
*
* return the @(prop.Name)
*/
- public @(prop.Type) @(prop.Type == "Boolean" ? "is" + prop.Name : "get" + prop.Name)()
+ @@Bindable
+ public @(prop.Type) @(prop.Type == "boolean" ? "is" + prop.Name : "get" + prop.Name)()
{
return @(prop.Description);
}
@@ -53,6 +56,7 @@ import com.twine.tango.dal.TangoDB;
public void set@(prop.Name)(@(prop.Type) @(prop.Description))
{
this.@(prop.Description) = @(prop.Description);
+ notifyPropertyChanged(BR.@(prop.Description));
}
</div>
}
diff --git a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
index 70664508c..ba950f3db 100644
--- a/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
+++ b/Software/Visual_Studio/Utilities/Tango.DBObservablesGenerator.CLI/ObservablesGenerator.cs
@@ -228,7 +228,7 @@ namespace Tango.DBObservablesGenerator.CLI
codeField.Type = DalNameToStandardName(field.PropertyType.Name).Singularize(false);
codeField.Construct = true;
}
- else if (field.PropertyType == typeof(Byte[]))
+ else if (field.PropertyType == typeof(Byte[]) || field.PropertyType == typeof(Boolean) || field.PropertyType == typeof(Double))
{
codeField.Type = field.PropertyType.Name.ToLower();
}