diff --git a/VECTO/Input Files/Vehicle.vb b/VECTO/Input Files/Vehicle.vb index 70aaab2ba722bb1feb32d4c849dd6f7282677c79..a84b744a4a8a2f1e33af319f809845756f67445b 100644 --- a/VECTO/Input Files/Vehicle.vb +++ b/VECTO/Input Files/Vehicle.vb @@ -14,7 +14,6 @@ Imports System.Collections.Generic Imports System.ComponentModel.DataAnnotations Imports System.IO Imports System.Linq -Imports System.Runtime.Remoting.Messaging Imports System.Xml Imports TUGraz.VECTO.Input_Files Imports TUGraz.VectoCommon.BusAuxiliaries diff --git a/VECTO3GUI2020/Helper/Converter/EnumConverter.cs b/VECTO3GUI2020/Helper/Converter/EnumConverter.cs index d5e45906213b5576229869a5d46f94f9a5e4f55f..12dffc1f3c7d409f7f595d909feacf1f81361475 100644 --- a/VECTO3GUI2020/Helper/Converter/EnumConverter.cs +++ b/VECTO3GUI2020/Helper/Converter/EnumConverter.cs @@ -1,12 +1,7 @@ using System; -using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; using System.Windows.Data; -using Castle.Core.Internal; using TUGraz.VectoCommon.Utils; namespace VECTO3GUI2020.Helper.Converter @@ -27,8 +22,7 @@ namespace VECTO3GUI2020.Helper.Converter var attributes = valueType.GetField(value.ToString())?.GetCustomAttributes( typeof(GuiLabelAttribute),false); - GuiLabelAttribute attribute = attributes.IsNullOrEmpty() ? null : attributes.First() as GuiLabelAttribute; - if (attribute == null) { + if (!(attributes?.First() is GuiLabelAttribute attribute)) { return value; } else { return attribute.Label; diff --git a/VECTO3GUI2020/Helper/FileHelper.cs b/VECTO3GUI2020/Helper/FileHelper.cs index 3cad81f50936a6ddab2eb8bfbb269f8016628293..8f5e688856ffefde01e4ce0ee8eaf1b15a02e5e9 100644 --- a/VECTO3GUI2020/Helper/FileHelper.cs +++ b/VECTO3GUI2020/Helper/FileHelper.cs @@ -1,5 +1,4 @@ using System.IO; -using Castle.Core.Internal; namespace VECTO3GUI2020.Helper { @@ -8,7 +7,7 @@ namespace VECTO3GUI2020.Helper public static void CreateDirectory(string fileName) { var dirName = Path.GetDirectoryName(fileName); - if (!dirName.IsNullOrEmpty()) { + if (!string.IsNullOrEmpty(dirName)) { Directory.CreateDirectory(dirName); } } diff --git a/VECTO3GUI2020/Helper/NameResolver.cs b/VECTO3GUI2020/Helper/NameResolver.cs index 45864264e138b4d3c6eb45f5b1aeb2e1cad89528..9191c69408fd08660ca3241e966f5759187538ae 100644 --- a/VECTO3GUI2020/Helper/NameResolver.cs +++ b/VECTO3GUI2020/Helper/NameResolver.cs @@ -1,5 +1,4 @@ using System.Resources; -using Castle.Core.Internal; namespace VECTO3GUI2020.Helper { @@ -10,10 +9,9 @@ namespace VECTO3GUI2020.Helper foreach (var resourceManager in resourceManagers) { var resolvedName = resourceManager?.GetString(propertyName); - if (!resolvedName.IsNullOrEmpty()) + if (!string.IsNullOrEmpty(resolvedName)) { return resolvedName; - break; } } diff --git a/VECTO3GUI2020/Helper/XMLExtension.cs b/VECTO3GUI2020/Helper/XMLExtension.cs index 921b9711e93bcefb92469fd45bf315f932611ae0..c8f11753b6efcad28890a9b62b4a4593d0dce88b 100644 --- a/VECTO3GUI2020/Helper/XMLExtension.cs +++ b/VECTO3GUI2020/Helper/XMLExtension.cs @@ -1,10 +1,7 @@ using System; -using System.Diagnostics; -using System.Windows.Forms; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; -using Castle.Core.Resource; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.Utils; diff --git a/VECTO3GUI2020/Helper/XmlHelper.cs b/VECTO3GUI2020/Helper/XmlHelper.cs index 872ad97935e4980681cb5ded3e819934adc3c58d..af8abe92b4bf8c5f6e0f6479ffaee6a9b75a1fbd 100644 --- a/VECTO3GUI2020/Helper/XmlHelper.cs +++ b/VECTO3GUI2020/Helper/XmlHelper.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; -using Castle.Core.Internal; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.Utils; @@ -18,11 +16,10 @@ namespace VECTO3GUI2020.Helper { public static XmlDocument ReadXmlDocument(string filePath) { - if (filePath.IsNullOrEmpty()) + if (string.IsNullOrEmpty(filePath)) return null; var xmlDocument = new XmlDocument(); - xmlDocument.Load(filePath); @@ -32,7 +29,7 @@ namespace VECTO3GUI2020.Helper public static XmlNodeList GetComponentNodes(XmlDocument xmlDocument, string parentNode, string nodeName) { - if (xmlDocument == null || parentNode.IsNullOrEmpty() || nodeName.IsNullOrEmpty()) + if (xmlDocument == null || string.IsNullOrEmpty(parentNode) || string.IsNullOrEmpty(nodeName)) return null; return xmlDocument.SelectNodes($"//*[local-name()='{parentNode}']//*[local-name()='{nodeName}']"); diff --git a/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs index 97c89dbee42dae4e3be87b0c04d4244067f89d9b..3280e145067b6b2a864f332c08624b3810836972 100644 --- a/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs +++ b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs @@ -50,8 +50,7 @@ namespace VECTO3GUI2020.Ninject.Util catch (Exception e) { throw new VectoException("failed to create instance for '{1}' via '{0}' version '{2}'", e, methodInfo.Name, methodInfo.ReturnType.Name, arguments[0]); - throw e; - } + } } } } diff --git a/VECTO3GUI2020/TestViewModel.cs b/VECTO3GUI2020/TestViewModel.cs index a21deb9371ad2743aae96ad7c4486c76d87d2bf1..8b0677c0c3d71ec997b4c37614fa1892221e2d98 100644 --- a/VECTO3GUI2020/TestViewModel.cs +++ b/VECTO3GUI2020/TestViewModel.cs @@ -1,18 +1,8 @@ using System; -using System.CodeDom; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Castle.Components.DictionaryAdapter; -using Castle.Core.Internal; -using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.Utils; using VECTO3GUI2020.Helper; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; -using VECTO3GUI2020.ViewModel.Interfaces.Common; namespace VECTO3GUI2020 { @@ -77,7 +67,7 @@ namespace VECTO3GUI2020 get => _testString; set { - if (value.IsNullOrEmpty()) { + if (string.IsNullOrEmpty(value)) { throw new VectoEmptyFieldException(); } SetProperty(ref _testString, value); diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs index aaeaa4fa379841f7b8f023942b9bab822ff7b9d4..07e369e7a66d2915158042fa391d8354cf1665b9 100644 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs @@ -1,13 +1,8 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml.Linq; -using Castle.Core.Internal; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Interfaces; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Util.XML.Interfaces; using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; @@ -80,7 +75,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_DeclaredCdxA, _inputData.AirDragArea.ToXMLFormat(2))); - dataElement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove(); + dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); } protected override void Initialize() diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs index 6bcc12e4bf3b21c211ae1a01abeef4e57752e643..57b1a4ba9b709c05cf039b5c4026294bdb168020 100644 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs @@ -1,6 +1,6 @@ using System.Linq; using System.Xml.Linq; -using Castle.Core.Internal; + using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; @@ -120,7 +120,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter dataElement.Add(hvacElement); } - dataElement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove(); + dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); } private void CreateElementsWithGroupWriters() diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs index 7dd3ad389046bb2be4eade6d4f3840e684365ae5..43fd5a161c5a9799b7a36a305ea0eb4b3db62720 100644 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs @@ -2,7 +2,6 @@ using System.Diagnostics; using System.Linq; using System.Xml.Linq; -using Castle.Core.Internal; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; @@ -302,7 +301,7 @@ namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter _inputData.ADAS.PredictiveCruiseControl.ToXMLFormat())); aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_ATEcoRollReleaseLockupClutch, _inputData.ADAS?.ATEcoRollReleaseLockupClutch )); } - _Xelement.DescendantsAndSelf().Where(e => e.Value.IsNullOrEmpty()).Remove(); + _Xelement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); if (_inputData.Components != null) { var componentElement = new XElement( diff --git a/VECTO3GUI2020/Util/XML/XMLNamespaces.cs b/VECTO3GUI2020/Util/XML/XMLNamespaces.cs index 174d4718ae56ab06bd2f6faf5b6b111778b4db47..c0053b0d80b7d34c33c4a9dbcc7b337cacb49431 100644 --- a/VECTO3GUI2020/Util/XML/XMLNamespaces.cs +++ b/VECTO3GUI2020/Util/XML/XMLNamespaces.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using System.Xml.Linq; -using Castle.Core.Internal; namespace VECTO3GUI2020.Util.XML { @@ -47,7 +42,7 @@ namespace VECTO3GUI2020.Util.XML public static string GetPrefix(XNamespace xNamespace) { - if (xNamespace.NamespaceName.IsNullOrEmpty()) { + if (string.IsNullOrEmpty(xNamespace.NamespaceName)) { return null; } string prefix = NamespacePrefix[xNamespace]; diff --git a/VECTO3GUI2020/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj index 7656b728279a54db18160b288679b036aed86a1f..f71f1d540e54c59b40934befd21ab6a162d977f5 100644 --- a/VECTO3GUI2020/VECTO3GUI2020.csproj +++ b/VECTO3GUI2020/VECTO3GUI2020.csproj @@ -20,8 +20,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="Castle.Core" Version="4.4.1" /> - <PackageReference Include="InteractiveDataDisplay.WPF" Version="1.0.0" /> + <PackageReference Include="InteractiveDataDisplay.WPF" Version="1.0.0" /> <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" /> <PackageReference Include="Microsoft.Maps.MapControl.WPF" Version="1.0.0.3" /> <PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> @@ -35,12 +34,6 @@ <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" /> </ItemGroup> - <ItemGroup> - <Reference Include="System.Windows.Controls.DataVisualization.Toolkit, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\System.Windows.Controls.DataVisualization.Toolkit.4.0.0.0\lib\net40-Client\System.Windows.Controls.DataVisualization.Toolkit.dll</HintPath> - </Reference> - </ItemGroup> - <ItemGroup> <Compile Update="Behaviours\AutoScrollDataGridBehaviour.cs" /> <Compile Update="Behaviours\PopUpHorizontalAlignmentBehavior.cs" /> diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs index 5ee05781a8fe37544ab138246e2cb3e607f6672b..480523a6357cd0ea5b61d48a2c42843dcc625a46 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs @@ -9,11 +9,9 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; -using System.Windows.Forms.VisualStyles; using System.Windows.Input; using System.Xml; using System.Xml.Linq; -using Castle.Core.Internal; using Microsoft.Toolkit.Mvvm.Input; using Newtonsoft.Json; using NLog; @@ -22,7 +20,6 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.XML; @@ -30,7 +27,6 @@ using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Impl; -using TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData.FileIO; using TUGraz.VectoCore.Utils; @@ -674,7 +670,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation var sortedOutputWriters = outputWriters.OrderBy(ow => ow.JobFile); foreach (var outputDataWriter in sortedOutputWriters) { var writtenFiles = outputDataWriter.GetWrittenFiles(); - if (writtenFiles.IsNullOrEmpty()) { + if (writtenFiles is null || writtenFiles.Count == 0) { continue; } var jobFileName = outputDataWriter.JobFile; diff --git a/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs index 9454c8c3a33eec87bc919532932cec88f7610813..c14355c9be665fad4de88691cb29487cb24bce4a 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs @@ -1,15 +1,11 @@ using System; using System.Collections.Generic; using VECTO3GUI2020.ViewModel.Interfaces; -using Ninject; -using System.Diagnostics; using System.Windows.Input; -using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using System.Reflection; using VECTO3GUI2020.Helper; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.Util; -using VECTO3GUI2020.Views; namespace VECTO3GUI2020.ViewModel.Implementation { diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs index 1d41ef524e942ef5600fcb4104fb4f42f74b583b..bb6775d561087fca633b18d5a41fafcc67edcf27 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs @@ -5,18 +5,13 @@ using System.IO; using System.Text; using System.Windows; using System.Windows.Input; -using Castle.Core.Internal; -using InteractiveDataDisplay.WPF; using Microsoft.Toolkit.Mvvm.Input; -using Microsoft.WindowsAPICodePack.Shell.Interop; using Newtonsoft.Json; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.XML; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; @@ -24,7 +19,6 @@ using VECTO3GUI2020.Model.Multistage; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; using VECTO3GUI2020.ViewModel.Interfaces.Document; -using Delegate = System.Delegate; namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs index d824dbb9b40e61db2214d76a6b23cfe28a94f9c5..b71ee967568c69cf69c4d20c96350f2d22f76696 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs @@ -6,25 +6,18 @@ using System.Diagnostics; using System.Resources; using System.Runtime.CompilerServices; using System.Xml; -using Castle.Core.Internal; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; -using TUGraz.VectoCore.Models.Declaration; using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Ninject; using VECTO3GUI2020.Properties; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; -using VECTO3GUI2020.ViewModel.MultiStage.Implementation; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; -using VECTO3GUI2020.Views.Multistage.CustomControls; -using Convert = System.Convert; using EnumHelper = VECTO3GUI2020.Helper.EnumHelper; namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation @@ -1227,14 +1220,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { get => String.Join(",", Errors.Values); } - public bool HasErrors - { - get - { - return !Error.IsNullOrEmpty() || - (MultistageAuxiliariesViewModel != null && MultistageAuxiliariesViewModel.HasErrors); - } - } + public bool HasErrors => + !string.IsNullOrEmpty(Error) || + (MultistageAuxiliariesViewModel != null && MultistageAuxiliariesViewModel.HasErrors); + #endregion private bool _airdragModifiedMultistepMandatory; diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs index 16267be61dce9cca942c7c27efecd26a28dfa3ec..4093dcb66c7d84beea74d21f38cd0d0577598762 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs @@ -6,7 +6,6 @@ using System.Diagnostics; using System.Resources; using System.Runtime.CompilerServices; using System.Xml; -using Castle.Core.Internal; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; @@ -666,15 +665,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } } - public bool HasErrors - { - get - { - var auxVmHasErrors = !Error.IsNullOrEmpty(); - - return auxVmHasErrors; - } - } + public bool HasErrors => !string.IsNullOrEmpty(Error); public Dictionary<string, MultistageParameterViewModel> ParameterViewModels { diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs index 32ac07cef143d4930f5351093dd56fa456764d32..cab099207f1e34c5edd8483e0625ebc2944d1c00 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs @@ -1,43 +1,29 @@ using System; -using System.CodeDom; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Text; using System.Windows; -using System.Windows.Forms; using System.Windows.Input; -using System.Windows.Navigation; -using System.Xml; using System.Xml.Linq; -using Castle.Core.Internal; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; -using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.XML; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Data; using TUGraz.VectoCore.Models.Simulation.Impl; -using TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory; using TUGraz.VectoCore.OutputData; using TUGraz.VectoCore.OutputData.FileIO; using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Helper.Converter; using VECTO3GUI2020.Ninject; using VECTO3GUI2020.Properties; using VECTO3GUI2020.Util; -using VECTO3GUI2020.Util.XML; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; -using VECTO3GUI2020.ViewModel.Interfaces.Common; using VECTO3GUI2020.ViewModel.Interfaces.Document; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; using INotifyPropertyChanged = System.ComponentModel.INotifyPropertyChanged; using XmlDocumentType = TUGraz.VectoCore.Utils.XmlDocumentType; @@ -157,7 +143,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation var auxiliariesErrorInfo = vehicleViewModel.MultistageAuxiliariesViewModel as IDataErrorInfo; - if (auxiliariesErrorInfo != null && !auxiliariesErrorInfo.Error.IsNullOrEmpty()) { + if (auxiliariesErrorInfo != null && !string.IsNullOrEmpty(auxiliariesErrorInfo.Error)) { errorMessage += "Auxiliaries\n"; errorMessage += auxiliariesErrorInfo.Error.Replace(",", "\n"); } @@ -363,12 +349,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => SetProperty(ref _selected, value); } - public bool CanBeSimulated - { - get - { - return (InputComplete && _inputData.JobInputData.ConsolidateManufacturingStage.Vehicle.VehicleDeclarationType == - VehicleDeclarationType.final) || (InputComplete && Exempted); + public bool CanBeSimulated { + get { + var declType = _inputData.JobInputData.ConsolidateManufacturingStage.Vehicle.VehicleDeclarationType; + return InputComplete && (declType == VehicleDeclarationType.final || Exempted); } set => throw new NotImplementedException(); } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs index 3bb13847a8ed793a7b530ae7e39a991e36cf34c3..137647f0f4dd5a22a42c6fe95f3b6a44ba9ab15d 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs @@ -6,7 +6,6 @@ using System.IO; using System.Windows; using System.Windows.Input; using System.Xml.Linq; -using Castle.Core.Internal; using Microsoft.Toolkit.Mvvm.Input; using Ninject; using TUGraz.VectoCommon.InputData; @@ -159,10 +158,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation errorMessage += vehicleErrorInfo.Error.Replace(",", "\n"); - var auxiliariesErrorInfo = - VehicleViewModel.MultistageAuxiliariesViewModel as IDataErrorInfo; - if (auxiliariesErrorInfo != null && - !auxiliariesErrorInfo.Error.IsNullOrEmpty()) { + if (VehicleViewModel.MultistageAuxiliariesViewModel is IDataErrorInfo auxiliariesErrorInfo && + !string.IsNullOrEmpty(auxiliariesErrorInfo.Error)) { errorMessage += "\nAuxiliaries:\n"; errorMessage += auxiliariesErrorInfo.Error.Replace(",", "\n"); } diff --git a/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj b/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj index 27998e2d08ce19905d48c7589b0a9a4b22f5f2a5..7a6a8c8fdb19a681c96c9822cb006ae4dbe0684d 100644 --- a/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj +++ b/VECTOAux/VectoAuxiliariesTests/VectoAuxiliariesTests.vbproj @@ -15,7 +15,6 @@ <ItemGroup> <PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" /> - <PackageReference Include="Castle.Core" Version="4.4.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Ninject" Version="3.3.4" /> <PackageReference Include="NLog" Version="4.7.13" /> diff --git a/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs b/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs index 278bbcba1f1610393009858163ebce167266b19e..946d49f7d954012bdee9cc2bd74cd23efcc5c35d 100644 --- a/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs +++ b/Vecto3GUI2020Test/HelperTests/BackingStorageTest.cs @@ -2,12 +2,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; -using System.Runtime.CompilerServices; -using Castle.Components.DictionaryAdapter; using NUnit.Framework; -using VECTO3GUI2020; using VECTO3GUI2020.ViewModel.Implementation.Common; -using VECTO3GUI2020.ViewModel.MultiStage.Implementation; namespace Vecto3GUI2020Test.HelperTests { diff --git a/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs b/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs index 633077948b4236687d05bf4053dde29f82c86e0c..9cf11d8a5ce7b1c78f7bb2b29ce035c9733b078c 100644 --- a/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs @@ -1,9 +1,7 @@ using System; -using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; -using Castle.Core.Logging; using Ninject; using NUnit.Framework; using TUGraz.VectoCommon.InputData; diff --git a/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs b/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs index 4fc8221fbe147f600fff74aefa9b60ce0449c689..082182fb8a8eb31c6d1ca3f68c59caaa70635f16 100644 --- a/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs +++ b/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs @@ -1,13 +1,5 @@ using System; -using System.Configuration; using System.IO; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Xml; -using Castle.Core.Internal; -using Castle.DynamicProxy.Generators.Emitters.SimpleAST; -using Moq; using Ninject; using NUnit.Framework; using TUGraz.VectoCommon.BusAuxiliaries; @@ -15,15 +7,6 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.XML; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; -using TUGraz.VectoCore.Models.Simulation.Impl; -using TUGraz.VectoCore.Models.SimulationComponent.Strategies; -using TUGraz.VectoCore.OutputData.FileIO; -using TUGraz.VectoCore.Utils; -using VECTO3GUI2020; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; namespace Vecto3GUI2020Test @@ -158,9 +141,9 @@ namespace Vecto3GUI2020Test var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as IMultistageVehicleViewModel; Assert.NotNull(vehicleViewModel); - Assert.IsTrue(vehicleViewModel.Manufacturer.IsNullOrEmpty()); - Assert.IsTrue(vehicleViewModel.ManufacturerAddress.IsNullOrEmpty()); - Assert.IsTrue(vehicleViewModel.VIN.IsNullOrEmpty()); + Assert.IsTrue(string.IsNullOrEmpty(vehicleViewModel.Manufacturer)); + Assert.IsTrue(string.IsNullOrEmpty(vehicleViewModel.ManufacturerAddress)); + Assert.IsTrue(string.IsNullOrEmpty(vehicleViewModel.VIN)); Assert.IsNull(vehicleViewModel.Model); var vehicleViewModelV28 = vehicleViewModel as InterimStageBusVehicleViewModel_v2_8; diff --git a/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs index fcd3071ec09189ab573310891c3a3a3ef59e4b6c..e733421e900bf80bfa4249cccb61011b3c006638 100644 --- a/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs @@ -1,19 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Castle.Core.Internal; -using Ninject; -using NUnit.Framework; +using NUnit.Framework; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.FileIO.XML; -using VECTO3GUI2020.Annotations; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; -using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; namespace Vecto3GUI2020Test.ViewModelTests { @@ -144,7 +132,8 @@ namespace Vecto3GUI2020Test.ViewModelTests var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; - Assert.IsTrue(vm.MultiStageJobViewModel.ManufacturingStages.IsNullOrEmpty()); + Assert.NotNull(vm.MultiStageJobViewModel.ManufacturingStages); + Assert.IsNotEmpty(vm.MultiStageJobViewModel.ManufacturingStages); Assert.NotNull(vehicleViewModel.ConsolidatedVehicleData); var consolidatedADAS = vehicleViewModel.ConsolidatedVehicleData.ADAS; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs index 1b8b21484fc5d433a1ee801be8e2c7e5a7bae194..2012d6daea235ebf055ff5108872254d1106f20e 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs @@ -31,12 +31,9 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Xml; using System.Xml.Linq; -using Castle.Core.Internal; using TUGraz.VectoCommon.BusAuxiliaries; -using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; @@ -729,7 +726,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - return motorTorqueLimits.IsNullOrEmpty() ? null : motorTorqueLimits; + return motorTorqueLimits.Count == 0 ? null : motorTorqueLimits; } private Tuple<Volt, TableData> ReadVoltageLevelNode(XmlNode voltageLevelNode) diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs index 40cf76cbc845c6e77bab131449927be9eb071130..a4abc2cbdf8deb6c05f504c065eef5d6ee35a5e2 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMachinesDeclarationInputDataProvider.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Xml; using System.Xml.Linq; -using Castle.Core.Internal; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; @@ -59,7 +58,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider var gearRatios = GetNode(XMLNames.ElectricMachine_P2_5GearRatios, null, false); if (gearRatios != null) { var gears = GetNodes(XMLNames.GearRatio_Ratio, gearRatios); - if (gears.IsNullOrEmpty()) + if (gears is null || gears.Count == 0) return; machineEntry.RatioPerGear = new double[gears.Count]; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs index cd9cd3e799c1bf1d76b467ff2c5d7d5cf86719ca..5b4e004570209e971071e75e546138deab6ff35f 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLElectricMotorDeclarationInputDataProvider.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Xml; using System.Xml.Linq; -using Castle.Core.Internal; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; @@ -99,7 +98,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider protected virtual IList<IElectricMotorVoltageLevel> GetVoltageLevels() { var voltageLevelNodes = GetNodes(XMLNames.ElectricMachine_VoltageLevel, BaseNode); - if (voltageLevelNodes.IsNullOrEmpty()) + if (voltageLevelNodes is null || voltageLevelNodes.Count == 0) return null; var voltageLevels = new List<IElectricMotorVoltageLevel>(); @@ -115,7 +114,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IList<IElectricMotorPowerMap> GetPowerMaps() { var powerMapNodes = GetNodes(XMLNames.PowerMap); - if (powerMapNodes.IsNullOrEmpty()) + if (powerMapNodes is null || powerMapNodes.Count == 0) return null; var powerMaps = new List<IElectricMotorPowerMap>(); @@ -355,7 +354,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IList<IDragCurve> GetDragCurves() { var dragCurveNodes = GetNodes(XMLNames.DragCurve, BaseNode); - if (dragCurveNodes.IsNullOrEmpty()) + if (dragCurveNodes is null || dragCurveNodes.Count == 0) return null; var dragCurves = new List<IDragCurve>(); @@ -369,7 +368,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IList<IGearEntry> GetGearEntries() { var gearNodes = GetNodes(XMLNames.Gear_EntryName); - if (gearNodes.IsNullOrEmpty()) + if (gearNodes is null || gearNodes.Count == 0) return null; var gears = new List<IGearEntry>(); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs index c2ba1718550f07f07bdc17ed1cb304dde542a061..31443709b435892ab6860cd2b8f78e8f7fd68ba0 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Xml; using System.Xml.Linq; -using Castle.Core.Internal; using Ninject; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; @@ -13,7 +11,6 @@ using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; -using TUGraz.VectoCore.OutputData.XML; using TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationFile; using TUGraz.VectoCore.Utils; @@ -99,7 +96,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl { get { - if (_manufacturingNodeStages.IsNullOrEmpty()) + if (_manufacturingNodeStages is null || _manufacturingNodeStages.Count == 0) return null; return _manufacturingStages ?? (_manufacturingStages = ManufacturingStagesCreator()); @@ -143,7 +140,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl { get { - if (ManufacturingStages.IsNullOrEmpty()) { + if (ManufacturingStages is null || ManufacturingStages.Count == 0) { _invalidEntries.Add("no manufacturing stages"); return false; } diff --git a/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs b/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs index 9780d7daaab9adab21ee3c8918af4c8d769bf537..f00b5ef9f38f39d4cc899e2be8783084e5f3a64e 100644 --- a/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs +++ b/VectoCore/VectoCore/OutputData/FileIO/TempFileOutputWriter.cs @@ -3,8 +3,6 @@ using System.Collections.Generic; using System.Data; using System.IO; using System.Xml.Linq; -using Castle.Core.Internal; -using TUGraz.VectoCommon.Models; namespace TUGraz.VectoCore.OutputData.FileIO { @@ -29,11 +27,10 @@ namespace TUGraz.VectoCore.OutputData.FileIO { BaseWriter = baseWriter; _reportsToWrite = new HashSet<ReportType>(); - if (!reportsToWrite.IsNullOrEmpty()) { + if (!(reportsToWrite is null)) foreach (var reportType in reportsToWrite) { _reportsToWrite.Add(reportType); } - } } #region Overrides of FileOutputWriter diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs index 783cb5fe39f44f4c1777fdab9a54c99091b7d407..5dd72293d0f4589e52283a20c0a24c32260ebf64 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationJobs/XMLCompletedBusWriter.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Text; using System.Xml; using System.Xml.Linq; -using Castle.Core.Internal; - namespace TUGraz.VectoCore.OutputData.XML.DeclarationJobs { @@ -23,7 +18,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationJobs public bool WriteCompletedBusXml(string filePath, XDocument xmlDocument) { - if (filePath.IsNullOrEmpty()) + if (string.IsNullOrEmpty(filePath)) return false; using (var xmlWriter = XmlWriter.Create(_stringBuilder, _xmlWriterSettings)) diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs index c0d005308ac847441b8a6449d9c4d99170284096..b5e32a7a021ee7eb94a07d0b2439e7d55c4de491 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; +using System.Xml.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCommon.Utils; diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs index cc19f92a53a27630b6ef3fec090ac9c7a3bd57a0..dcc05754ef4298df12451302a3db203a86ba65c4 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; +using System.Xml.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.CompletedBus diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs index 88c063c9141421612de13ed525f46b22e335cda0..4de8ce5d7b280829e1df71cfcfec10053addf0be 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs index 4efe71fc36acdb9c76da679fd472f98361e9d9fd..d9eb80284c982e61a129083eb2561a6282b7b0ac 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; +using System.Xml.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.Utils; diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs index 3434644cd7f51b6692d912e76603c79a64631474..ef235c4a944bda8429943f5d97151b3e28e909e4 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; +using System.Xml.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs index a78df6dce1f1c618631bc2e26383fe9df7f09343..e6471f322012fa320f56d1eb34697954c7f95999 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs @@ -1,12 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Components.Auxiliaries { diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs index 855e9a2b2b60d82d475f527807ce85de7fdc7bef..fb1acfd11c5d401f29126f559b33ea1f8c826de9 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs index fbb371887bff5782cec17632ebe8dcfb4a01b729..0c1694035f0232e115e095a2260c62d6034431d7 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; +using System.Xml.Linq; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs index 305dcbc82cd5adc7a49f144c07e24d220701d70d..3ae468591a1c5229b88697a8c03f027decda2eab 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupWriter.cs @@ -1,8 +1,4 @@ -using System.Collections.Generic; -using System.Configuration; -using System.Xml.Linq; -using Castle.Components.DictionaryAdapter; -using TUGraz.VectoCommon.InputData; +using System.Xml.Linq; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { diff --git a/VectoCore/VectoCore/Utils/PathHelper.cs b/VectoCore/VectoCore/Utils/PathHelper.cs index 469751b156404c51f796493cf90ec95e44f933ea..2459f872dbc37fd28167a8fe1f6155bd3756367d 100644 --- a/VectoCore/VectoCore/Utils/PathHelper.cs +++ b/VectoCore/VectoCore/Utils/PathHelper.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using Castle.Core.Internal; namespace TUGraz.VectoCore.Utils { @@ -27,8 +26,8 @@ namespace TUGraz.VectoCore.Utils } - var pathArray = pathFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !s.IsNullOrEmpty()); - var relativeToArray = relativeFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !s.IsNullOrEmpty()); + var pathArray = pathFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !string.IsNullOrEmpty(s)); + var relativeToArray = relativeFullPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Where(s => !string.IsNullOrEmpty(s)); var result = GetRelativePath(relativeToArray, pathArray); diff --git a/VectoCore/VectoCore/Utils/XMLHelper.cs b/VectoCore/VectoCore/Utils/XMLHelper.cs index 7e315fa5d8e6a2c6364c3539c3bf1c93dc4839c8..573e7a847b7dc44f9b8c1a930723abe3630f87eb 100644 --- a/VectoCore/VectoCore/Utils/XMLHelper.cs +++ b/VectoCore/VectoCore/Utils/XMLHelper.cs @@ -36,7 +36,6 @@ using System.Linq; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; -using Castle.Core.Internal; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; @@ -319,7 +318,7 @@ namespace TUGraz.VectoCore.Utils public static void AddIfContentNotNull(this XElement xElement, XElement xElementToAdd) { - if (!xElementToAdd.Value.IsNullOrEmpty()){ + if (!string.IsNullOrEmpty(xElementToAdd.Value)){ xElement.Add(xElementToAdd); } } diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 2733448c6da0af9bf771551d2f5bb4fd22dbe093..ef035eb22ec67f57ca20deded23cbdae7d4bbe2f 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -11,7 +11,6 @@ <PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" /> - <PackageReference Include="Castle.Core" Version="4.4.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Ninject" Version="3.3.4" /> <PackageReference Include="NLog" Version="4.7.13" />