From 30926a8078c75c5d8c4ed39b053f072940c30d9a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 7 Jul 2019 14:45:14 +0300 Subject: Removed Deffered delete from ObservableEntity. Added Delete for Cascade Delete. --- .../Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index fc762d77d..e343313b4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -150,7 +150,8 @@ namespace Tango.MachineStudio.DB.ViewModels { try { - await SelectedEntity.DeleteAsync(Adapter.Context); + SelectedEntity.Detach(Adapter.Context); + await Adapter.Context.SaveChangesAsync(); } catch (Exception ex) { -- cgit v1.3.1 From 081d332a0494d309c2762f76f9dc5032a673ea0d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 7 Jul 2019 15:05:28 +0300 Subject: Removed Object extension methods from global namespace. --- .../ViewModels/MainViewVM.cs | 1 + .../ViewModels/DbTableViewModel.cs | 1 + .../ViewModels/MainViewVM.cs | 1 + .../ViewModels/MainViewVM.cs | 1 + .../Converters/LogItemToMessageConverter.cs | 1 + .../TechItems/ProcessParametersItem.cs | 1 + .../ViewModels/MachineTechViewVM.cs | 1 + .../EventLogging/DefaultEventLogger.cs | 1 + .../TFS/TeamFoundationServiceExtendedClient.cs | 1 + .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 1 + .../ViewModels/MainViewVM.cs | 1 + .../Connection/DefaultMachineProvider.cs | 1 + .../MachineSetup/MachineSetupManager.cs | 1 + .../MachineUpdate/MachineUpdateManager.cs | 1 + .../PPCApplication/DefaultPPCApplicationManager.cs | 1 + .../ViewModels/ExternalBridgeViewVM.cs | 1 + .../ColorConversion/TangoColorConverter.cs | 1 + Software/Visual_Studio/Tango.BL/Entities/Job.cs | 31 +- .../Visual_Studio/Tango.ColorConversion/Class1.cs | 12 + .../Properties/AssemblyInfo.cs | 9 + .../Tango.ColorConversion.csproj | 71 +++++ .../Tango.ColorConversion/packages.config | 4 + .../ExtensionMethods/ObjectExtensions.cs | 333 +++++++++++---------- .../Tango.Emulations/Emulators/MachineEmulator.cs | 1 + .../ExternalBridge/ExternalBridgeService.cs | 1 + .../DefaultGradientGenerationConfiguration.cs | 1 + .../Tango.Integration/Operation/MachineOperator.cs | 1 + .../Tango.Integration/Storage/StorageManager.cs | 1 + .../Converters/DisplayMemberPathConverter.cs | 1 + .../Tango.Touch/Controls/LightTouchDataGrid.cs | 1 + .../Tango.Touch/Controls/TouchAutoComplete.cs | 1 + .../Tango.Touch/Controls/TouchListBox.cs | 1 + .../Tango.Touch/Controls/TouchNativeListBox.cs | 1 + .../Tango.Touch/Controls/TouchNotificationBar.cs | 1 + .../Tango.UnitTesting/Pulse/Pulse_TST.cs | 1 + Software/Visual_Studio/Tango.sln | 54 +++- .../Tango.AlarmParametersGenerator/Program.cs | 1 + .../Tango.EventsTypesGenerator/Program.cs | 1 + 38 files changed, 364 insertions(+), 181 deletions(-) create mode 100644 Software/Visual_Studio/Tango.ColorConversion/Class1.cs create mode 100644 Software/Visual_Studio/Tango.ColorConversion/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj create mode 100644 Software/Visual_Studio/Tango.ColorConversion/packages.config (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs index 88882afdd..3be6bf8e2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs @@ -20,6 +20,7 @@ using System.Windows.Media.Imaging; using System.Windows.Threading; using Tango.Core; using Tango.Core.Commands; +using Tango.Core.ExtensionMethods; using Tango.Core.Threading; using Tango.CSV; using Tango.Logging; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index e343313b4..83be6c3b4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -17,6 +17,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations.Schema; using Tango.BL; using Tango.Core.DI; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.DB.ViewModels { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 3811453cb..b0b6cfcb3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -47,6 +47,7 @@ using System.Runtime.ExceptionServices; using Tango.BL.Builders; using Tango.MachineStudio.Common.Navigation; using System.Diagnostics; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.Developer.ViewModels { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs index 73ba02435..6cc8289f4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs @@ -12,6 +12,7 @@ using Tango.BL; using Tango.SharedUI.Components; using System.Runtime.CompilerServices; using Tango.MachineStudio.Common; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.HardwareDesigner.ViewModels { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs index 7136b22ea..7890d055b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; +using Tango.Core.ExtensionMethods; using Tango.Logging; using Tango.PMR.Common; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs index 4aedf8bc7..5e6bffa82 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs @@ -9,6 +9,7 @@ using System.Xml.Serialization; using Tango.BL; using Tango.BL.Entities; using Tango.Core.Commands; +using Tango.Core.ExtensionMethods; using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.Technician.TechItems diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index ab5d2ebb1..1a1832120 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -38,6 +38,7 @@ using RealTimeGraphX; using RealTimeGraphX.DataPoints; using Tango.MachineStudio.Technician.Views; using RealTimeGraphX.WPF; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.Technician.ViewModels { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs index 79c032967..11d156292 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/EventLogging/DefaultEventLogger.cs @@ -17,6 +17,7 @@ using Tango.MachineStudio.Common.Diagnostics; using Tango.MachineStudio.Common.StudioApplication; using Tango.PMR.Diagnostics; using Tango.Integration.Operation; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.Common.EventLogging { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs index df831afb9..fba037a6e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using System.Windows; using Tango.BL.Entities; using Tango.Core.DI; +using Tango.Core.ExtensionMethods; using Tango.Core.Helpers; using Tango.Core.IO; using Tango.Integration.Operation; diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index 9862a4afb..248003b30 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -35,6 +35,7 @@ using Tango.Pulse; using System.Windows.Media.Imaging; using Tango.Touch.Components; using Tango.PPC.Jobs.ViewContracts; +using Tango.Core.ExtensionMethods; namespace Tango.PPC.Jobs.ViewModels { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index b413fee0d..8ed512670 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -13,6 +13,7 @@ using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.Core.DI; +using Tango.Core.ExtensionMethods; using Tango.PPC.Common; using Tango.PPC.Common.Connection; using Tango.PPC.Common.ExternalBridge; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 04f64bd9c..7b3d85b75 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -20,6 +20,7 @@ using Tango.Transport.Transporters; using Tango.Integration; using Tango.Transport; using System.Threading; +using Tango.Core.ExtensionMethods; namespace Tango.PPC.Common.Connection { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index 39ff7e54d..05cf15a38 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -13,6 +13,7 @@ using System.Threading; using System.Threading.Tasks; using Tango.Core; using Tango.Core.DB; +using Tango.Core.ExtensionMethods; using Tango.Core.Helpers; using Tango.Core.IO; using Tango.Integration.Operation; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 31b2f5534..64123acca 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -11,6 +11,7 @@ using System.Threading; using System.Threading.Tasks; using Tango.Core; using Tango.Core.DB; +using Tango.Core.ExtensionMethods; using Tango.Core.Helpers; using Tango.Core.IO; using Tango.Integration.Operation; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 7aeb6760e..d4adc30a0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -31,6 +31,7 @@ using Tango.PPC.Common.WatchDog; using Tango.PPC.UI.Dialogs; using Tango.Core.Threading; using Tango.PPC.Common.Messages; +using Tango.Core.ExtensionMethods; namespace Tango.PPC.UI.PPCApplication { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs index 80a95d1bf..f1127ebfe 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Tango.BL.Entities; using Tango.Core.Commands; using Tango.Core.DI; +using Tango.Core.ExtensionMethods; using Tango.Integration.ExternalBridge; using Tango.PMR.Integration; using Tango.PPC.Common; diff --git a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs index d5ec5ab15..e6a305677 100644 --- a/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs +++ b/Software/Visual_Studio/Tango.BL/ColorConversion/TangoColorConverter.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using System.Windows.Media; using Tango.BL.Entities; using Tango.BL.Enumerations; +using Tango.Core.ExtensionMethods; using Tango.Logging; using Tango.PMR; using Tango.PMR.ColorLab; diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 0780e6787..6e6ffcf48 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -13,6 +13,7 @@ using System.Windows.Media.Imaging; using Tango.BL.Builders; using Tango.BL.Enumerations; using Tango.Core; +using Tango.Core.ExtensionMethods; using Tango.Logging; using Tango.PMR.Exports; @@ -22,14 +23,26 @@ namespace Tango.BL.Entities { private double _lastLength; + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public Job() : base() + { + + } + /// /// Initializes a new instance of the class. /// - public Job(DateTime creationDate) + public Job(DateTime creationDate) : this() { CreationDate = creationDate; } + #endregion + #region Events /// @@ -183,6 +196,9 @@ namespace Tango.BL.Entities } private JobDesignations _designation; + /// + /// Gets or sets the designation. + /// [NotMapped] [JsonIgnore] public JobDesignations Designation @@ -191,6 +207,9 @@ namespace Tango.BL.Entities set { _designation = value; RaisePropertyChangedAuto(); } } + /// + /// Gets or sets the state of the job editing. + /// [NotMapped] [JsonIgnore] public EditingStates JobEditingState @@ -478,7 +497,7 @@ namespace Tango.BL.Entities /// public Task GetEstimatedDuration() { - return Task.Factory.StartNew(() => + return Task.Factory.StartNew(() => { var process = GetRecommendedProcessParameters().Result; return GetEstimatedDuration(process); @@ -719,13 +738,5 @@ namespace Tango.BL.Entities } #endregion - - /// - /// Initializes a new instance of the class. - /// - public Job() : base() - { - - } } } diff --git a/Software/Visual_Studio/Tango.ColorConversion/Class1.cs b/Software/Visual_Studio/Tango.ColorConversion/Class1.cs new file mode 100644 index 000000000..b420411b6 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/Class1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.ColorConversion +{ + public class Class1 + { + } +} diff --git a/Software/Visual_Studio/Tango.ColorConversion/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.ColorConversion/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..f5e12a622 --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - Color Conversion Library")] +[assembly: AssemblyVersion("2.0.17.1657")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj b/Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj new file mode 100644 index 000000000..2846ca99a --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/Tango.ColorConversion.csproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7} + Library + Properties + Tango.ColorConversion + Tango.ColorConversion + v4.6.1 + 512 + true + + + true + full + false + ..\Build\Core\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\Build\Core\Release\ + TRACE + prompt + 4 + + + + ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + + + + + + + + + + + GlobalVersionInfo.cs + + + + + + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.ColorConversion/packages.config b/Software/Visual_Studio/Tango.ColorConversion/packages.config new file mode 100644 index 000000000..fa3c0d58d --- /dev/null +++ b/Software/Visual_Studio/Tango.ColorConversion/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs index ce907b57b..b5e430829 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs @@ -10,226 +10,229 @@ using System.Threading.Tasks; using Tango.Core.Json; using Tango.Serialization; -/// -/// Contains extension methods. -/// -public static class ObjectExtensions +namespace Tango.Core.ExtensionMethods { - private static bool _jsonSettingsSet; - /// - /// Performs shallow cloning of the object excluding generic properties.. + /// Contains extension methods. /// - /// - /// The object. - /// - public static T ShallowClone(this T obj) + public static class ObjectExtensions { - var cloned = Activator.CreateInstance(); - - foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.SetMethod != null)) + private static bool _jsonSettingsSet; + + /// + /// Performs shallow cloning of the object excluding generic properties.. + /// + /// + /// The object. + /// + public static T ShallowClone(this T obj) { - if (!prop.PropertyType.IsGenericType) + var cloned = Activator.CreateInstance(); + + foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.SetMethod != null)) { - prop.SetValue(cloned, prop.GetValue(obj)); + if (!prop.PropertyType.IsGenericType) + { + prop.SetValue(cloned, prop.GetValue(obj)); + } } - } - return cloned; - } + return cloned; + } - /// - /// Performs a shallow mapping to the specified object excluding generic properties. - /// - /// - /// The source. - /// The destination object. - public static void ShallowCopyTo(this T source, T destination) - { - foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.SetMethod != null)) + /// + /// Performs a shallow mapping to the specified object excluding generic properties. + /// + /// + /// The source. + /// The destination object. + public static void ShallowCopyTo(this T source, T destination) { - if (!prop.PropertyType.IsGenericType) + foreach (var prop in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.SetMethod != null)) { - prop.SetValue(destination, prop.GetValue(source)); + if (!prop.PropertyType.IsGenericType) + { + prop.SetValue(destination, prop.GetValue(source)); + } } } - } - /// - /// Maps the object properties values to the destination object. - /// - /// The source. - /// The destination. - public static void MapPrimitivesTo(this object source, object destination) - { - foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive)) + /// + /// Maps the object properties values to the destination object. + /// + /// The source. + /// The destination. + public static void MapPrimitivesTo(this object source, object destination) { - var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); - - if (desProp != null && desProp.PropertyType.IsPrimitive && desProp.SetMethod != null) + foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive)) { - desProp.SetValue(destination, prop.GetValue(source)); + var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); + + if (desProp != null && desProp.PropertyType.IsPrimitive && desProp.SetMethod != null) + { + desProp.SetValue(destination, prop.GetValue(source)); + } } } - } - /// - /// Maps the object properties values to the destination object including strings and without assigning null string values from the source. - /// - /// The source. - /// The destination. - public static void MapPrimitivesWithStringsNoNullsTo(this object source, object destination) - { - foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive || x.PropertyType == typeof(String))) + /// + /// Maps the object properties values to the destination object including strings and without assigning null string values from the source. + /// + /// The source. + /// The destination. + public static void MapPrimitivesWithStringsNoNullsTo(this object source, object destination) { - var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); - - if (desProp != null && (desProp.PropertyType.IsPrimitive || desProp.PropertyType == typeof(String)) && desProp.SetMethod != null) + foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive || x.PropertyType == typeof(String))) { - var value = prop.GetValue(source); + var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); - if (desProp.PropertyType != typeof(String) || !String.IsNullOrEmpty(value as String)) + if (desProp != null && (desProp.PropertyType.IsPrimitive || desProp.PropertyType == typeof(String)) && desProp.SetMethod != null) { - desProp.SetValue(destination, value); + var value = prop.GetValue(source); + + if (desProp.PropertyType != typeof(String) || !String.IsNullOrEmpty(value as String)) + { + desProp.SetValue(destination, value); + } } } } - } - /// - /// Maps the object properties values to the destination object including strings and without assigning null string values from the source. - /// - /// The source. - /// The destination. - public static void MapPrimitivesWithStrings(this object source, object destination) - { - foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive || x.PropertyType == typeof(String))) + /// + /// Maps the object properties values to the destination object including strings and without assigning null string values from the source. + /// + /// The source. + /// The destination. + public static void MapPrimitivesWithStrings(this object source, object destination) { - var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); - - if (desProp != null && (desProp.PropertyType.IsPrimitive || desProp.PropertyType == typeof(String)) && desProp.SetMethod != null) + foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive || x.PropertyType == typeof(String))) { - var value = prop.GetValue(source); + var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); + + if (desProp != null && (desProp.PropertyType.IsPrimitive || desProp.PropertyType == typeof(String)) && desProp.SetMethod != null) + { + var value = prop.GetValue(source); - desProp.SetValue(destination, value); + desProp.SetValue(destination, value); + } } } - } - /// - /// Maps the object properties values to the destination object. - /// - /// The source. - /// The destination. - public static void MapPrimitivesTo(this object source, object destination, Func condition) - { - foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive)) + /// + /// Maps the object properties values to the destination object. + /// + /// The source. + /// The destination. + public static void MapPrimitivesTo(this object source, object destination, Func condition) { - var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); - - if (desProp != null && desProp.PropertyType.IsPrimitive && desProp.SetMethod != null) + foreach (var prop in source.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(x => x.PropertyType.IsPrimitive)) { - if (condition(prop)) + var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); + + if (desProp != null && desProp.PropertyType.IsPrimitive && desProp.SetMethod != null) { - desProp.SetValue(destination, prop.GetValue(source)); + if (condition(prop)) + { + desProp.SetValue(destination, prop.GetValue(source)); + } } } } - } - - /// - /// Serializes the specified object to indented json string. - /// - /// The object. - /// - public static String ToJsonString(this Object obj) - { - if (obj == null) return "null"; - if (!_jsonSettingsSet) + /// + /// Serializes the specified object to indented json string. + /// + /// The object. + /// + public static String ToJsonString(this Object obj) { - JsonConvert.DefaultSettings = (() => - { - var settings = new JsonSerializerSettings(); - settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); - settings.ContractResolver = new ProtobufContractResolver(); - return settings; - }); - - _jsonSettingsSet = true; - } + if (obj == null) return "null"; - return JsonConvert.SerializeObject(obj, Formatting.Indented); - } + if (!_jsonSettingsSet) + { + JsonConvert.DefaultSettings = (() => + { + var settings = new JsonSerializerSettings(); + settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); + settings.ContractResolver = new ProtobufContractResolver(); + return settings; + }); - /// - /// Serializes the specified object to indented json string. - /// - /// The object. - /// - public static String ToJsonString(this Object obj, params String[] ignoreProperties) - { - var settings = new JsonSerializerSettings() { ContractResolver = new DynamicContractResolver(ignoreProperties) }; - settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); - return JsonConvert.SerializeObject(obj, Formatting.Indented, settings); - } + _jsonSettingsSet = true; + } - /// - /// Serializes the specified object to indented json html string. - /// - /// The object. - /// - public static String ToHtmlJsonString(this Object obj, params String[] ignoreProperties) - { - var settings = new JsonSerializerSettings() { ContractResolver = new HtmlContractResolver(ignoreProperties) }; - settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); - return JsonConvert.SerializeObject(obj, Formatting.Indented, settings); - } + return JsonConvert.SerializeObject(obj, Formatting.Indented); + } - /// - /// Gets the property value by the specified path (e.g DateTime.Date.Days). - /// - /// The object. - /// The property path. - /// - public static Object GetPropertyValueByPath(this object obj, String propertyPath) - { - if (propertyPath != null) + /// + /// Serializes the specified object to indented json string. + /// + /// The object. + /// + public static String ToJsonString(this Object obj, params String[] ignoreProperties) { - if (propertyPath.Contains('.')) - { - string[] Split = propertyPath.Split('.'); - string RemainingProperty = propertyPath.Substring(propertyPath.IndexOf('.') + 1); - return GetPropertyValueByPath(obj.GetType().GetProperty(Split[0]).GetValue(obj, null), RemainingProperty); - } - else - return obj.GetType().GetProperty(propertyPath).GetValue(obj, null); + var settings = new JsonSerializerSettings() { ContractResolver = new DynamicContractResolver(ignoreProperties) }; + settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); + return JsonConvert.SerializeObject(obj, Formatting.Indented, settings); } - else + + /// + /// Serializes the specified object to indented json html string. + /// + /// The object. + /// + public static String ToHtmlJsonString(this Object obj, params String[] ignoreProperties) { - return obj.ToString(); + var settings = new JsonSerializerSettings() { ContractResolver = new HtmlContractResolver(ignoreProperties) }; + settings.Converters.Add(new StringEnumConverter { CamelCaseText = false }); + return JsonConvert.SerializeObject(obj, Formatting.Indented, settings); } - } - /// - /// Sets the property value by the specified path (e.g DateTime.Date.Days). - /// - /// The object. - /// The property path. - /// - public static void SetPropertyValueByPath(this object obj, String propertyPath, object value) - { - if (propertyPath != null) + /// + /// Gets the property value by the specified path (e.g DateTime.Date.Days). + /// + /// The object. + /// The property path. + /// + public static Object GetPropertyValueByPath(this object obj, String propertyPath) { - if (propertyPath.Contains('.')) + if (propertyPath != null) { - string[] Split = propertyPath.Split('.'); - string RemainingProperty = propertyPath.Substring(propertyPath.IndexOf('.') + 1); - SetPropertyValueByPath(obj.GetType().GetProperty(Split[0]).GetValue(obj, null), RemainingProperty, value); + if (propertyPath.Contains('.')) + { + string[] Split = propertyPath.Split('.'); + string RemainingProperty = propertyPath.Substring(propertyPath.IndexOf('.') + 1); + return GetPropertyValueByPath(obj.GetType().GetProperty(Split[0]).GetValue(obj, null), RemainingProperty); + } + else + return obj.GetType().GetProperty(propertyPath).GetValue(obj, null); } else { - obj.GetType().GetProperty(propertyPath).SetValue(obj, value); + return obj.ToString(); + } + } + + /// + /// Sets the property value by the specified path (e.g DateTime.Date.Days). + /// + /// The object. + /// The property path. + /// + public static void SetPropertyValueByPath(this object obj, String propertyPath, object value) + { + if (propertyPath != null) + { + if (propertyPath.Contains('.')) + { + string[] Split = propertyPath.Split('.'); + string RemainingProperty = propertyPath.Substring(propertyPath.IndexOf('.') + 1); + SetPropertyValueByPath(obj.GetType().GetProperty(Split[0]).GetValue(obj, null), RemainingProperty, value); + } + else + { + obj.GetType().GetProperty(propertyPath).SetValue(obj, value); + } } } } diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 401123106..61cca98ce 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -30,6 +30,7 @@ using System.IO; using Tango.Integration.Operation; using Tango.PMR.FirmwareUpgrade; using System.Diagnostics; +using Tango.Core.ExtensionMethods; namespace Tango.Emulations.Emulators { diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs index 16a143bbc..410afd7fe 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs @@ -19,6 +19,7 @@ using Tango.PMR.Diagnostics; using Tango.PMR.Debugging; using System.Security.Authentication; using Tango.Settings; +using Tango.Core.ExtensionMethods; namespace Tango.Integration.ExternalBridge { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs b/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs index c4a8518ee..59c6441d3 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/DefaultGradientGenerationConfiguration.cs @@ -8,6 +8,7 @@ using Tango.BL.ColorConversion; using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Core; +using Tango.Core.ExtensionMethods; namespace Tango.Integration.Operation { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 5b6b9b3a6..766448bcc 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -35,6 +35,7 @@ using Tango.Integration.Logging; using Tango.Integration.JobRuns; using Tango.FirmwareUpdateLib.WPF; using Tango.FirmwareUpdateLib; +using Tango.Core.ExtensionMethods; namespace Tango.Integration.Operation { diff --git a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs index 623e331d0..7db7433fa 100644 --- a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs +++ b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading.Tasks; using Tango.Core; using Tango.Core.Commands; +using Tango.Core.ExtensionMethods; using Tango.Core.Threading; using Tango.Logging; using Tango.PMR.IO; diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs index 6e0a75df5..f195afc9c 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; +using Tango.Core.ExtensionMethods; namespace Tango.SharedUI.Converters { diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs index 60ef8a49e..79e6739af 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs @@ -17,6 +17,7 @@ using System.Windows.Media; using System.Windows.Media.Animation; using Tango.Core.Commands; using Tango.Core.EventArguments; +using Tango.Core.ExtensionMethods; using Tango.DragAndDrop; using Tango.SharedUI.Helpers; using Tango.Touch.Components; diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs index 4e1ced33b..986cc55f4 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.cs @@ -16,6 +16,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Tango.Core.Commands; using Tango.Core.EventArguments; +using Tango.Core.ExtensionMethods; namespace Tango.Touch.Controls { diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs index 57afcb943..87e7717be 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs @@ -17,6 +17,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Tango.Core.Commands; using Tango.Core.EventArguments; +using Tango.Core.ExtensionMethods; namespace Tango.Touch.Controls { diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.cs index aab20778e..f05e98ccc 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.cs @@ -12,6 +12,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.ExtensionMethods; namespace Tango.Touch.Controls { diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs index 0f7468011..9f18ec8d4 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs @@ -20,6 +20,7 @@ using System.Windows.Shapes; using System.Windows.Threading; using Tango.Core.Commands; using Tango.Core.EventArguments; +using Tango.Core.ExtensionMethods; namespace Tango.Touch.Controls { diff --git a/Software/Visual_Studio/Tango.UnitTesting/Pulse/Pulse_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Pulse/Pulse_TST.cs index c20994198..b643e71ec 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Pulse/Pulse_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Pulse/Pulse_TST.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.ExtensionMethods; using Tango.Core.IO; using Tango.Pulse; diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 163bff4f1..db1cf4634 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -297,6 +297,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.CoatsCatalogImporter" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.AlarmParametersGenerator", "Utilities\Tango.AlarmParametersGenerator\Tango.AlarmParametersGenerator.csproj", "{CC6D5193-434D-410F-B0F3-BE2017D86FCE}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ColorConversion", "Tango.ColorConversion\Tango.ColorConversion.csproj", "{B4FE6485-4161-4B36-BC08-67E0B53D01B7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution AppVeyor|Any CPU = AppVeyor|Any CPU @@ -5285,6 +5287,46 @@ Global {CC6D5193-434D-410F-B0F3-BE2017D86FCE}.Release|x64.Build.0 = Release|Any CPU {CC6D5193-434D-410F-B0F3-BE2017D86FCE}.Release|x86.ActiveCfg = Release|Any CPU {CC6D5193-434D-410F-B0F3-BE2017D86FCE}.Release|x86.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|Any CPU.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|Any CPU.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|ARM.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|ARM.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|ARM64.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|ARM64.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|x64.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|x64.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|x86.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.AppVeyor|x86.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|ARM.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|ARM.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|ARM64.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|x64.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|x64.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|x86.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Debug|x86.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|Any CPU.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|Any CPU.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|ARM.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|ARM.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|ARM64.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|ARM64.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|x64.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|x64.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|x86.ActiveCfg = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.DefaultBuild|x86.Build.0 = Debug|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|Any CPU.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|ARM.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|ARM.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|ARM64.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|ARM64.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|x64.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|x64.Build.0 = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|x86.ActiveCfg = Release|Any CPU + {B4FE6485-4161-4B36-BC08-67E0B53D01B7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -5382,12 +5424,12 @@ Global {CC6D5193-434D-410F-B0F3-BE2017D86FCE} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - BuildVersion_UseGlobalSettings = False - BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs - BuildVersion_StartDate = 2000/1/1 - BuildVersion_UpdateFileVersion = False - BuildVersion_UpdateAssemblyVersion = True - BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} + BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear + BuildVersion_UpdateAssemblyVersion = True + BuildVersion_UpdateFileVersion = False + BuildVersion_StartDate = 2000/1/1 + BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs + BuildVersion_UseGlobalSettings = False EndGlobalSection EndGlobal diff --git a/Software/Visual_Studio/Utilities/Tango.AlarmParametersGenerator/Program.cs b/Software/Visual_Studio/Utilities/Tango.AlarmParametersGenerator/Program.cs index 04d6acb5b..ac31cfb9c 100644 --- a/Software/Visual_Studio/Utilities/Tango.AlarmParametersGenerator/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.AlarmParametersGenerator/Program.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.ExtensionMethods; using Tango.Core.Helpers; using Tango.Documents; using Tango.PMR.Debugging; diff --git a/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs b/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs index 6797ac085..20b27d7d5 100644 --- a/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.EventsTypesGenerator/Program.cs @@ -10,6 +10,7 @@ using Tango.Core.Helpers; using Tango.Documents; using System.Data.Entity; using System.Collections.ObjectModel; +using Tango.Core.ExtensionMethods; namespace Tango.EventsTypesGenerator { -- cgit v1.3.1 From b2e41ba5213c6a7f08cf8bcb2e4e2654aa6a6224 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 11 Jul 2019 14:01:43 +0300 Subject: Refactored CCT to single CCT per RML. --- .../ViewModels/MainViewVM.cs | 45 +--- .../Views/MainView.xaml | 2 +- .../ViewModels/CctsViewVM.cs | 8 +- .../ViewModels/MainViewVM.cs | 4 +- .../ViewModels/MainViewVM.cs | 70 ++++++- .../Tango.MachineStudio.RML/Views/RmlView.xaml | 2 +- .../Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs | 2 +- .../Printing/DefaultPrintingManager.cs | 2 +- .../Visual_Studio/Tango.BL/Builders/RmlBuilder.cs | 16 +- .../Tango.BL/Builders/RmlsCollectionBuilder.cs | 19 +- Software/Visual_Studio/Tango.BL/DTO/CctDTOBase.cs | 28 +-- Software/Visual_Studio/Tango.BL/DTO/RmlDTOBase.cs | 8 + .../Visual_Studio/Tango.BL/Entities/CctBase.cs | 226 ++++----------------- .../Visual_Studio/Tango.BL/Entities/RmlBase.cs | 59 ++++-- .../Tango.BL/Enumerations/ColorCatalogsItems.cs | 6 + .../Tango.BL/ObservablesContextAdapter.cs | 10 - .../Tango.ColorConversion/DefaultColorConverter.cs | 4 +- Software/Visual_Studio/Tango.DAL.Remote/DB/CCT.cs | 17 +- Software/Visual_Studio/Tango.DAL.Remote/DB/RML.cs | 5 +- .../Tango.DAL.Remote/DB/RemoteADO.edmx | 83 ++++---- .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 148 +++++++------- .../DefaultGradientGenerationConfiguration.cs | 2 +- .../Tango.Integration/Operation/MachineOperator.cs | 10 +- 23 files changed, 336 insertions(+), 440 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs index a106ea184..94fa36e57 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/MainViewVM.cs @@ -248,12 +248,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels public RelayCommand ImportForwardDataCommand { get; set; } - public RelayCommand ImportInverseDataCommand { get; set; } - public RelayCommand ExportForwardDataCommand { get; set; } - public RelayCommand ExportInverseDataCommand { get; set; } - public RelayCommand SaveCommand { get; set; } #endregion @@ -274,10 +270,8 @@ namespace Tango.MachineStudio.ColorLab.ViewModels SourceColor.ColorChanged += SourceColor_ColorChanged; ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => SelectedRML != null && IsFree); - ImportInverseDataCommand = new RelayCommand(ImportInverseData, () => SelectedRML != null && IsFree); - ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.ForwardFileName != null && IsFree); - ExportInverseDataCommand = new RelayCommand(ExportInverseData, () => SelectedRML != null && CCT != null && CCT.InverseFileName != null && IsFree); + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => SelectedRML != null && CCT != null && CCT.FileName != null && IsFree); SaveCommand = new RelayCommand(Save, () => SelectedRML != null && IsFree); } @@ -336,13 +330,13 @@ namespace Tango.MachineStudio.ColorLab.ViewModels { try { - if (LiquidsCalibrationData == null || CCT.ForwardData == null) return; + if (LiquidsCalibrationData == null || CCT.Data == null) return; ConversionInput input = new ConversionInput(); input.ColorSpace = SourceColor.IsLab ? PMR.ColorLab.ColorSpace.Lab : PMR.ColorLab.ColorSpace.Rgb; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(CCT.Data); input.InputCoordinates = new InputCoordinates(); input.InputCoordinates.Red = (int)SourceColor.Red; @@ -455,36 +449,17 @@ namespace Tango.MachineStudio.ColorLab.ViewModels String file = GetCCTFileOpen(); if (file != null) { - CCT.ForwardFileName = Path.GetFileName(file); - CCT.ForwardData = File.ReadAllBytes(file); - } - } - - private void ImportInverseData() - { - String file = GetCCTFileOpen(); - if (file != null) - { - CCT.InverseFileName = Path.GetFileName(file); - CCT.InverseData = File.ReadAllBytes(file); + CCT.FileName = Path.GetFileName(file); + CCT.Data = File.ReadAllBytes(file); } } private void ExportForwardData() { - String file = GetCCTFileSave(CCT.ForwardFileName); - if (file != null) - { - File.WriteAllBytes(file, CCT.ForwardData); - } - } - - private void ExportInverseData() - { - String file = GetCCTFileSave(CCT.InverseFileName); + String file = GetCCTFileSave(CCT.FileName); if (file != null) { - File.WriteAllBytes(file, CCT.InverseData); + File.WriteAllBytes(file, CCT.Data); } } @@ -573,7 +548,7 @@ namespace Tango.MachineStudio.ColorLab.ViewModels input.ColorSpace = PMR.ColorLab.ColorSpace.Volume; input.DeltaChroma = DeltaChroma; input.DeltaL = DeltaL; - input.ForwardData = ByteString.CopyFrom(CCT.ForwardData); + input.ForwardData = ByteString.CopyFrom(CCT.Data); input.InputCoordinates = new InputCoordinates(); input.ThreadL = 92.1815; //SelectedRML.MediaColor.L; @@ -695,12 +670,12 @@ namespace Tango.MachineStudio.ColorLab.ViewModels } _isNewCCT = false; - CCT = SelectedRML.Ccts.FirstOrDefault(); + CCT = SelectedRML.Cct; if (CCT == null) { CCT = new Cct(); - CCT.Rml = SelectedRML; + SelectedRML.Cct = CCT; _isNewCCT = true; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml index d78424d4e..888945579 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Views/MainView.xaml @@ -148,7 +148,7 @@ - + public RelayCommand RemoveRmlCommand { get; set; } + public RelayCommand ImportForwardDataCommand { get; set; } + + public RelayCommand ExportForwardDataCommand { get; set; } + public RelayCommand AddProcessParametersTableCommand { get; set; } public RelayCommand RemoveProcessParametersTableCommand { get; set; } @@ -165,6 +169,10 @@ namespace Tango.MachineStudio.RML.ViewModels RemoveLiquidFactorCommand = new RelayCommand(RemoveLiquidFactor, () => IsFree); CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate); SaveCommand = new RelayCommand(Save, () => IsFree); + + ImportForwardDataCommand = new RelayCommand(ImportForwardData, () => ActiveRML != null && IsFree); + + ExportForwardDataCommand = new RelayCommand(ExportForwardData, () => ActiveRML != null && ActiveRML.Cct != null && IsFree); } public override void OnApplicationReady() @@ -199,6 +207,7 @@ namespace Tango.MachineStudio.RML.ViewModels .Set(guid) .WithActiveParametersGroup() .WithLiquidFactors() + .WithCCT() .BuildAsync(); if (ActiveRML.ProcessParametersTablesGroups.ToList().Count == 0) @@ -251,6 +260,8 @@ namespace Tango.MachineStudio.RML.ViewModels View.NavigateTo(RmlNavigationView.RmlView); + InvalidateRelayCommands(); + IsFree = true; } } @@ -491,5 +502,62 @@ namespace Tango.MachineStudio.RML.ViewModels View.NavigateTo(RmlNavigationView.RmlsView); LoadRmls(); } + + #region Import / Export Color Conversion Data + + private void ImportForwardData() + { + String file = GetCCTFileOpen(); + if (file != null) + { + if (ActiveRML.Cct == null) + { + Cct cct = new Cct(); + ActiveRML.Cct = cct; + } + + ActiveRML.Cct.FileName = Path.GetFileName(file); + ActiveRML.Cct.Data = File.ReadAllBytes(file); + } + } + + private void ExportForwardData() + { + String file = GetCCTFileSave(ActiveRML.Cct.FileName); + if (file != null) + { + File.WriteAllBytes(file, ActiveRML.Cct.Data); + } + } + + private String GetCCTFileOpen() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + private String GetCCTFileSave(String fileName) + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Title = "Select color adjustment file"; + dlg.Filter = "Color Conversion Table|*.cct"; + dlg.FileName = fileName; + dlg.DefaultExt = ".cct"; + if (dlg.ShowDialogCenter()) + { + return dlg.FileName; + } + + return null; + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index e43c20c3d..962e59291 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -148,7 +148,7 @@ - + @@ -850,19 +844,19 @@ @@ -896,6 +890,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + + + + + - + - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml index 97eceaa7d..b13ffb87b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml @@ -109,7 +109,7 @@ - Hardware Version + Hardware Version @@ -284,7 +284,7 @@ - + @@ -337,7 +337,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -367,9 +367,9 @@ - IDS PACKS + IDS PACKS - + @@ -404,7 +404,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -465,11 +465,11 @@ - + - + @@ -495,7 +495,7 @@ - + @@ -517,8 +517,8 @@ - - v + + v @@ -527,7 +527,7 @@ - + @@ -549,11 +549,11 @@ - + - + @@ -575,12 +575,12 @@ - - v + + v - + @@ -602,12 +602,12 @@ - - v + + v - + @@ -629,12 +629,12 @@ - - v + + v - + @@ -656,12 +656,12 @@ - - v + + v - + @@ -683,12 +683,12 @@ - - v + + v - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml index 8c9fe7179..6a8b7c9b0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineSettingsView.xaml @@ -27,7 +27,7 @@ - + @@ -42,19 +42,19 @@ Machine Version - + Organization - + Default RML - + Loaded RML - + Default Color Space - + Default Segment Length @@ -68,7 +68,7 @@ Device COM Port - + Auto Login diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml index 41dc0554c..466e6f458 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachinesView.xaml @@ -60,7 +60,7 @@ - + + @@ -67,24 +76,32 @@ - + - + + + + - + - + - + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml index e6a18ddde..a8daa4540 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/Views/MainView.xaml @@ -9,7 +9,7 @@ xmlns:local="clr-namespace:Tango.MachineStudio.Stubs.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource DarkGrayBrush}" Foreground="Gainsboro" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="{StaticResource DarkGrayBrush}" Foreground="{StaticResource BorderBrushGainsboro}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml index b6bfefd8c..1936a90d2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml @@ -52,7 +52,7 @@ Length - + Winding Method @@ -64,10 +64,10 @@ Inter Segment Length - + Number of Units - + Enable Lubrication diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml index 7da979a00..82052f02f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/MultiGraphTemplate.xaml @@ -49,11 +49,11 @@ Minimum - + Maximum - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml index 3830ecc3e..037ae0693 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/SingleGraphTemplate.xaml @@ -49,11 +49,11 @@ Minimum - + Maximum - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml index 1cb7876cf..5eb72e65b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/ImportProjectTabView.xaml @@ -26,7 +26,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml index 2d180a8a2..63d22d365 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml @@ -77,40 +77,40 @@ - + - + - + - + - + - + - + - + @@ -140,105 +140,105 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -464,11 +464,11 @@ Left - + Top - + @@ -476,11 +476,11 @@ Width - + Height - + @@ -491,7 +491,7 @@ Angle - + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml index f8045d7a6..d5a5d41d7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml @@ -28,7 +28,7 @@ - + @@ -39,7 +39,7 @@ ADDRESS - + @@ -51,7 +51,7 @@ CONTACT - + @@ -107,7 +107,7 @@ - + - - - - - - @@ -162,7 +156,7 @@ - + @@ -175,14 +169,18 @@ - + - + - + @@ -190,13 +188,7 @@ - - - - - - - + @@ -205,8 +197,11 @@ - - + + @@ -217,13 +212,7 @@ - - - - - - - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml index 7f135efbc..cd218f663 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveComboControl.xaml @@ -39,7 +39,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml index 6f352f35c..013dca6ce 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml @@ -39,7 +39,7 @@ - + @@ -174,7 +174,7 @@ - NO IDS PACKS + NO IDS PACKS @@ -195,7 +195,7 @@ - + @@ -238,7 +238,7 @@ - + @@ -247,7 +247,7 @@ - + @@ -255,7 +255,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 0433ff7be..2920c8dd9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -135,6 +135,11 @@ namespace Tango.MachineStudio.Common return DeploymentSlot.ToAddress(); } + /// + /// Gets or sets the working theme. + /// + public MachineStudioTheme Theme { get; set; } + /// /// Initializes a new instance of the class. /// @@ -149,6 +154,7 @@ namespace Tango.MachineStudio.Common JobUploadStrategy = JobUploadStrategy.JobDescriptionFile; MaximumCacheTime = TimeSpan.FromMinutes(5); CachingMode = ObservablesContextInMemoryCachingMode.None; + Theme = MachineStudioTheme.Light; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioTheme.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioTheme.cs new file mode 100644 index 000000000..16dda143b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioTheme.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common +{ + public enum MachineStudioTheme + { + Light, + Dark + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index 03c6649d6..0bf472a2e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -24,11 +24,12 @@ - - - - + + @@ -139,9 +140,9 @@ AllowsTransparency="True" PopupAnimation="Slide" Focusable="False"> - @@ -286,7 +287,7 @@ - + @@ -477,7 +478,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs index 6b1a86741..d422df26c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/SharedResourceDictionary.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; +using Tango.Settings; namespace Tango.MachineStudio.Common.Resources { @@ -34,6 +35,11 @@ namespace Tango.MachineStudio.Common.Resources set { _sourceUri = value; + var settings = SettingsManager.Default.GetOrCreate(); + //add current theme + MachineStudioTheme wTheme = settings.Theme; + if ((wTheme == MachineStudioTheme.Dark && value.LocalPath.Contains("Light")) || (wTheme == MachineStudioTheme.Light && value.LocalPath.Contains("Dark"))) + return; if (!_sharedDictionaries.ContainsKey(value)) { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index c368a499c..62f2dc984 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -93,6 +93,7 @@ + @@ -186,6 +187,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml new file mode 100644 index 000000000..ad8f0f09b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/DarkThemeColors.xaml @@ -0,0 +1,301 @@ + + + + + + + + + 0.7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #5C5C5C + #5C5C5C + #5C5C5C + #FF03A9F4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml index 90b3b0829..25f72f8d4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Themes/LightThemeColors.xaml @@ -1,9 +1,14 @@  + xmlns:local="clr-namespace:Tango.MachineStudio.Common.Themes" + xmlns:system="clr-namespace:System;assembly=mscorlib"> + + + - + 1 + @@ -44,9 +49,7 @@ - - - + @@ -73,6 +76,13 @@ + + + + + + + @@ -87,26 +97,49 @@ - - + - + + + + - + - + + + - - - + + + + + + + + + + + + + + + - + + + + + + + + @@ -153,6 +186,34 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml index 11ab79afd..618035112 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml @@ -12,6 +12,7 @@ + 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 2e2b1a014..edcc4ba39 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -64,12 +64,14 @@ namespace Tango.MachineStudio.UI LogManager.Log("Application Started..."); LogManager.LogReferencedAssemblies(); + var settings = SettingsManager.Default.GetOrCreate(); + //add current theme + MachineStudioTheme wTheme = settings.Theme; base.OnStartup(e); LogManager.Categories.Clear(); - var settings = SettingsManager.Default.GetOrCreate(); if (settings.LoggingCategories.Count == 0) { @@ -104,7 +106,9 @@ namespace Tango.MachineStudio.UI { LogManager.Log("EF Caching is disabled"); } + } + #region Global Exception Trapping diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml index 810114144..eecbcf8ad 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml @@ -9,7 +9,7 @@ xmlns:sharedControls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" Title="Tango" Height="800" Width="1280" Foreground="{StaticResource MainWindow.Foreground}" - BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" Background="{DynamicResource MainWindow.Background}"> + BorderThickness="1" BorderBrush="{StaticResource AccentColorBrush}" Background="{DynamicResource MainWindow.Background}" WindowTitleBrush="{StaticResource MainWindow.WindowTitleColorBrush}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml index 2eb1080cb..41405f7fb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml @@ -10,7 +10,7 @@ Title="Machine Studio" MinHeight="220" SizeToContent="WidthAndHeight" MinWidth="600" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent" ShowInTaskbar="False"> - + @@ -18,7 +18,7 @@ - diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml index 8f9512236..e037e3630 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml @@ -15,7 +15,7 @@ - + @@ -30,8 +30,8 @@ - - + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml index 5e27071ec..5cc3d719b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml @@ -15,7 +15,7 @@ - + @@ -32,10 +32,10 @@ - + - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index b2faf346e..31ba4e57d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -174,6 +175,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// public RelayCommand AboutCommand { get; set; } + /// + /// Gets or sets the about command. + /// + public RelayCommand ChangeAppThemeCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// /// Gets or sets the authentication provider. @@ -336,6 +342,8 @@ namespace Tango.MachineStudio.UI.ViewModels TangoMessenger.Default.Register((x) => DisableCheckForUpdates = true); AboutCommand = new RelayCommand(ShowAboutDialog); + + ChangeAppThemeCommand = new RelayCommand(ChangeTheme); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable e) @@ -926,5 +934,15 @@ namespace Tango.MachineStudio.UI.ViewModels IsApplicationReady = true; } } + + private void ChangeTheme(MachineStudioTheme theme) + { + var settings = SettingsManager.Default.GetOrCreate(); + //add current theme + settings.Theme = theme; + settings.Save(); + + _notificationProvider.ShowInfo("Changes will be applies after application restart."); + } } } 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 bf9a52b98..a5ffe9964 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml @@ -10,7 +10,7 @@ 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}}"> + d:DesignHeight="300" d:DesignWidth="300" Width="600" Height="700" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:AboutViewVM, IsDesignTimeCreatable=False}" DataContext="{Binding AboutViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -61,23 +61,23 @@ Data Source: - () + () Caching Mode: - (Requires restart) + (Requires restart) Job Upload Strategy: - (Requires restart) + (Requires restart) Change Log: - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml index 8dfb04f1f..1734a9c94 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectedMachineView.xaml @@ -12,7 +12,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Width="640" Height="500" Background="White" DataContext="{Binding ConnectedMachineViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="300" d:DesignWidth="300" Width="640" Height="500" Background="{StaticResource Dialog.Background}" DataContext="{Binding ConnectedMachineViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml index ded02ab47..b2fa2b3e3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ConnectionLostView.xaml @@ -7,7 +7,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - Width="559" Height="266" Background="White" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}"> + Width="559" Height="266" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ConnectionLostViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -43,7 +43,7 @@ Reason: - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml index 9af5c6b06..233f8e4cb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/FirmwareUpgradeView.xaml @@ -9,7 +9,7 @@ xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Width="800" Height="400" Background="White" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}"> + d:DesignHeight="300" d:DesignWidth="300" Width="800" Height="400" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:FirmwareUpgradeViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -39,7 +39,7 @@ FIRMWARE UPGRADE - + @@ -61,7 +61,7 @@ - + @@ -86,7 +86,7 @@ Upgrading Machine Firmware - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml index 6e804c61d..df1c1b831 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml @@ -27,7 +27,7 @@ - + v diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml index d39b1226c..69ce4c855 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -10,7 +10,7 @@ xmlns:emulations="clr-namespace:Tango.Emulations.ExternalBridge;assembly=Tango.Emulations" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Width="630" Height="400" Background="White" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="300" d:DesignWidth="300" Width="630" Height="400" Background="{StaticResource Dialog.Background}" DataContext="{Binding MachineConnectionViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -53,7 +53,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml index 14967686f..7d0b2e25c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml @@ -9,7 +9,7 @@ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="200" d:DesignWidth="550" Background="White" DataContext="{Binding MachineLoginViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="200" d:DesignWidth="550" Background="{StaticResource MainWindow.Background}" DataContext="{Binding MachineLoginViewVM, Source={StaticResource Locator}}" Foreground="{StaticResource MainWindow.Foreground}"> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml index b988d0a76..eea90c7b9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineSerialView.xaml @@ -8,7 +8,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:vm="clr-namespace:Tango.MachineStudio.UI.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="559" Height="266" Background="White" d:DataContext="{d:DesignInstance Type=vm:MachineSerialViewVM, IsDesignTimeCreatable=False}"> + mc:Ignorable="d" Width="559" Height="266" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:MachineSerialViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -54,7 +54,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index 57b8335c5..5513b65ac 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -9,6 +9,7 @@ xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:common="clr-namespace:Tango.MachineStudio.Common;assembly=Tango.MachineStudio.Common" xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" @@ -43,7 +44,7 @@ - + - MODULES - + MODULES + @@ -125,7 +126,7 @@ - + @@ -142,11 +143,11 @@ + Mode="PrimaryMid" DockPanel.Dock="Top" Background="{StaticResource MainWindow.Header}"> - + + + + + + + - + - - + + @@ -470,7 +480,7 @@ @@ -132,7 +132,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml index d1ff75fc7..92317a5d5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ResolvedIssuesView.xaml @@ -12,7 +12,7 @@ xmlns:tfs="clr-namespace:Tango.TFS;assembly=Tango.TFS" xmlns:tfss="clr-namespace:Tango.MachineStudio.UI.TFS" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="530" Height="580" Background="White" d:DataContext="{d:DesignInstance Type=vm:ResolvedIssuesViewVM, IsDesignTimeCreatable=False}"> + mc:Ignorable="d" Width="530" Height="580" Background="{StaticResource MainWindow.Background}" d:DataContext="{d:DesignInstance Type=vm:ResolvedIssuesViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -39,7 +39,7 @@ - +