aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/DBViewContextWrapper.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-01-31 10:11:27 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-01-31 10:11:27 +0200
commitb55483f9f095b699728e0b587ceebfdf6409a48a (patch)
tree1d424d3fc9f75154ecae30806b952fdfb029fce9 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/DBViewContextWrapper.cs
parente027cb9fdd17fe3be7bb2c385dc37061a7eea8bb (diff)
parent2fa92ca3654ebb274482f9bad86231028d357e5a (diff)
downloadTango-b55483f9f095b699728e0b587ceebfdf6409a48a.tar.gz
Tango-b55483f9f095b699728e0b587ceebfdf6409a48a.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/DBViewContextWrapper.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/DBViewContextWrapper.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/DBViewContextWrapper.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/DBViewContextWrapper.cs
new file mode 100644
index 000000000..21611a493
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/DBViewContextWrapper.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Integration.Observables;
+
+namespace Tango.MachineStudio.Developer.ViewModels
+{
+ public class DBViewContextWrapper<T> where T : class, IObservableEntity
+ {
+ public T EditEntity { get; set; }
+
+ public ObservablesEntitiesAdapter Adapter { get; set; }
+
+ public DBViewContextWrapper()
+ {
+ Adapter = ObservablesEntitiesAdapter.Instance;
+ }
+
+ public DBViewContextWrapper(T entity) : this()
+ {
+ EditEntity = entity;
+ }
+
+ public static implicit operator DBViewContextWrapper<T>(T entity)
+ {
+ return new DBViewContextWrapper<T>(entity);
+ }
+
+ public static implicit operator T(DBViewContextWrapper<T> instance)
+ {
+ return instance.EditEntity;
+ }
+ }
+}