aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-03-10 09:06:35 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-03-10 09:06:35 +0200
commitabc70316f80a9cb05b320828051bb7dcbfeaad1b (patch)
treea334c1cc23b307710f6338523e5c20fb09017665 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parentcbdd79778764ce38017790e1e1f9316e52ec8104 (diff)
parent7256fe1c07cf5ecbe485c3cdac238b88dfc2cd1d (diff)
downloadTango-abc70316f80a9cb05b320828051bb7dcbfeaad1b.tar.gz
Tango-abc70316f80a9cb05b320828051bb7dcbfeaad1b.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs20
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs10
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml7
4 files changed, 37 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
index d4598867c..2e2b1a014 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs
@@ -84,6 +84,26 @@ namespace Tango.MachineStudio.UI
exceptionTrapper = new WpfGlobalExceptionTrapper();
exceptionTrapper.Initialize(this);
exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed;
+
+ //Apply Caching
+ if (settings.CachingMode != ObservablesContextInMemoryCachingMode.None)
+ {
+ LogManager.Log("EF Caching is enabled.");
+ LogManager.Log($"EF Caching mode is: {settings.CachingMode}.");
+ LogManager.Log($"EF Caching timeout: {settings.MaximumCacheTime.ToString()}");
+ try
+ {
+ ObservablesContext.EnableInMemoryCache(settings.MaximumCacheTime, settings.CachingMode);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error while trying to activate EF caching.");
+ }
+ }
+ else
+ {
+ LogManager.Log("EF Caching is disabled");
+ }
}
#region Global Exception Trapping
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index d6fb50a8c..7aa9ae890 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -84,7 +84,15 @@ namespace Tango.MachineStudio.UI.Authentication
ObservablesContext.OverrideSettingsDataSource(response.DataSource);
}
- ObservablesStaticCollections.Instance.Initialize();
+ try
+ {
+ ObservablesStaticCollections.Instance.Initialize();
+ }
+ catch (System.Data.Entity.Core.MetadataException)
+ {
+ ObservablesContext.ClearModelStore();
+ ObservablesStaticCollections.Instance.Initialize();
+ }
using (ObservablesContext db = ObservablesContext.CreateDefault())
{
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
index f313e9073..8440c88b2 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs
@@ -4,5 +4,5 @@ using System.Runtime.InteropServices;
[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyTitle("Tango - Machine Studio")]
-[assembly: AssemblyVersion("4.0.9.0")]
+[assembly: AssemblyVersion("4.0.10.0")]
[assembly: ComVisible(false)] \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml
index 640c3c1df..54a8349e6 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml
@@ -6,6 +6,7 @@
xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:bl="clr-namespace:Tango.BL;assembly=Tango.BL"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="700" Background="White" d:DataContext="{d:DesignInstance Type=vm:AboutViewVM, IsDesignTimeCreatable=False}" DataContext="{Binding AboutViewVM, Source={StaticResource Locator}}">
@@ -13,6 +14,7 @@
<UserControl.Resources>
<converters:VersionToShortVersionConverter x:Key="VersionToShortVersionConverter" />
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
+ <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
</UserControl.Resources>
<Grid>
@@ -60,6 +62,11 @@
<TextBlock><Run Text="{Binding DataSource.Address,Mode=OneWay}"></Run>
<Run>(</Run><Run Foreground="Gray" Text="{Binding DataSource.Catalog,Mode=OneWay}"></Run><Run>)</Run>
</TextBlock>
+ <TextBlock FontWeight="SemiBold">Caching Mode:</TextBlock>
+ <DockPanel>
+ <ComboBox Width="150" DockPanel.Dock="Left" ItemsSource="{Binding Source={x:Type bl:ObservablesContextInMemoryCachingMode},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding MachineStudioSettings.CachingMode}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox>
+ <TextBlock Margin="20 0 0 0" Foreground="Gray" VerticalAlignment="Center">(Requires restart)</TextBlock>
+ </DockPanel>
</controls:TableGrid>
<DockPanel Margin="0 0 0 0">