Index: Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs =================================================================== diff -u -r657702880ff3dc471e8e034e6111944c948305b6 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 657702880ff3dc471e8e034e6111944c948305b6) +++ Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -125,42 +125,6 @@ } /// - /// Looks up a localized string similar to De geometrie die opgegeven werd voor de referentielijn heeft geen waarde.. - /// - public static string ReferenceLine_SetGeometry_New_geometry_cannot_be_null { - get { - return ResourceManager.GetString("ReferenceLine_SetGeometry_New_geometry_cannot_be_null", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Een punt in de geometrie voor de referentielijn heeft geen waarde.. - /// - public static string ReferenceLine_SetGeometry_New_geometry_has_null_coordinate { - get { - return ResourceManager.GetString("ReferenceLine_SetGeometry_New_geometry_has_null_coordinate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Bestand bevat 1 multi-polylijn, welke niet ondersteund is.. - /// - public static string ReferenceLineReader_File_contains_unsupported_multi_polyline { - get { - return ResourceManager.GetString("ReferenceLineReader_File_contains_unsupported_multi_polyline", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Bestand moet exact 1 gehele polylijn bevatten.. - /// - public static string ReferenceLineReader_File_must_contain_1_polyline { - get { - return ResourceManager.GetString("ReferenceLineReader_File_must_contain_1_polyline", resourceCulture); - } - } - - /// /// Looks up a localized string similar to De geometrie bevat geen punt op locatie ({0},{1},{2}) om als karakteristiek punt in te stellen.. /// public static string RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point { Index: Core/Common/src/Core.Common.Base/Properties/Resources.resx =================================================================== diff -u -r657702880ff3dc471e8e034e6111944c948305b6 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision 657702880ff3dc471e8e034e6111944c948305b6) +++ Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -138,18 +138,6 @@ Ringtoets Copyright (C) 2016 Stichting Deltares. Dit programma komt ZONDER ENIGE GARANTIE. Dit programma is gratis en u mag het zelf verder verspreiden en/of aanpassen overeenkomstig de GNU Lesser General Public License versie 3. - - De geometrie die opgegeven werd voor de referentielijn heeft geen waarde. - - - Een punt in de geometrie voor de referentielijn heeft geen waarde. - - - Bestand moet exact 1 gehele polylijn bevatten. - - - Bestand bevat 1 multi-polylijn, welke niet ondersteund is. - De geometrie bevat geen punt op locatie ({0},{1},{2}) om als karakteristiek punt in te stellen. Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/AreaDataTreeNodeInfoTest.cs =================================================================== diff -u -ra1de055e3698f610875e623d39f4526970568cef -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/AreaDataTreeNodeInfoTest.cs (.../AreaDataTreeNodeInfoTest.cs) (revision a1de055e3698f610875e623d39f4526970568cef) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/AreaDataTreeNodeInfoTest.cs (.../AreaDataTreeNodeInfoTest.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -32,6 +32,12 @@ info = treeNodeInfoLookup[typeof(AreaData)]; } + [TearDown] + public void TearDown() + { + legendView.Dispose(); + } + [Test] public void Initialized_Always_ExpectedPropertiesSet() { Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/ChartDataCollectionTreeNodeInfoTest.cs =================================================================== diff -u -rae6c53b67bd2ae5e49606b31fd1575eecc58620d -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/ChartDataCollectionTreeNodeInfoTest.cs (.../ChartDataCollectionTreeNodeInfoTest.cs) (revision ae6c53b67bd2ae5e49606b31fd1575eecc58620d) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/ChartDataCollectionTreeNodeInfoTest.cs (.../ChartDataCollectionTreeNodeInfoTest.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -33,6 +33,12 @@ info = treeNodeInfoLookup[typeof(ChartDataCollection)]; } + [TearDown] + public void TearDown() + { + legendView.Dispose(); + } + [Test] public void Initialized_Always_ExpectedPropertiesSet() { Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendControllerTest.cs =================================================================== diff -u -r0d7895f07d2c1b15457ffdc8e8762780a5837030 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendControllerTest.cs (.../LegendControllerTest.cs) (revision 0d7895f07d2c1b15457ffdc8e8762780a5837030) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendControllerTest.cs (.../LegendControllerTest.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -43,12 +43,12 @@ { // Setup var mocks = new MockRepository(); - var plugin = mocks.StrictMock(); - plugin.Expect(p => p.IsToolWindowOpen()).Return(open); + var toolViewController = mocks.StrictMock(); + toolViewController.Expect(p => p.IsToolWindowOpen()).Return(open); mocks.ReplayAll(); - var controller = new LegendController(plugin); + var controller = new LegendController(toolViewController); // Call var result = controller.IsLegendViewOpen(); @@ -65,22 +65,22 @@ { // Setup var mocks = new MockRepository(); - var plugin = mocks.StrictMock(); + var toolViewController = mocks.StrictMock(); if (open) { - plugin.Expect(p => p.IsToolWindowOpen()).Return(false); - plugin.Expect(p => p.OpenToolView(Arg.Matches(c => true))); - plugin.Expect(p => p.CloseToolView(Arg.Matches(c => true))); + toolViewController.Expect(p => p.IsToolWindowOpen()).Return(false); + toolViewController.Expect(p => p.OpenToolView(Arg.Matches(c => true))); + toolViewController.Expect(p => p.CloseToolView(Arg.Matches(c => true))); } else { - plugin.Expect(p => p.OpenToolView(Arg.Matches(c => true))); + toolViewController.Expect(p => p.OpenToolView(Arg.Matches(c => true))); } - plugin.Expect(p => p.IsToolWindowOpen()).Return(open); + toolViewController.Expect(p => p.IsToolWindowOpen()).Return(open); mocks.ReplayAll(); - var controller = new LegendController(plugin); + var controller = new LegendController(toolViewController); if (open) { Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendViewTest.cs =================================================================== diff -u -rb6d165f6edddc4271e94c5f6d70c12d4ba0c60eb -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendViewTest.cs (.../LegendViewTest.cs) (revision b6d165f6edddc4271e94c5f6d70c12d4ba0c60eb) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LegendViewTest.cs (.../LegendViewTest.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -16,53 +16,58 @@ public void DefaultConstructor_CreatesUserControl() { // Call - var view = new LegendView(); - - // Assert - Assert.IsInstanceOf(view); - Assert.IsInstanceOf(view); - Assert.IsNull(view.Data); - Assert.AreEqual(Resources.General_Chart, view.Text); + using (var view = new LegendView()) + { + // Assert + Assert.IsInstanceOf(view); + Assert.IsInstanceOf(view); + Assert.IsNull(view.Data); + Assert.AreEqual(Resources.General_Chart, view.Text); + } } [Test] public void Data_BaseChart_DataSet() { // Setup - var view = new LegendView(); - var baseChart = new ChartDataCollection(new List()); + using (var view = new LegendView()) + { + var baseChart = new ChartDataCollection(new List()); - // Call - view.Data = baseChart; + // Call + view.Data = baseChart; - // Assert - Assert.AreSame(baseChart, view.Data); + // Assert + Assert.AreSame(baseChart, view.Data); + } } [Test] public void Data_ForNull_NullSet() { // Setup - var view = new LegendView(); + using (var view = new LegendView()) + { + // Call + view.Data = null; - // Call - view.Data = null; - - // Assert - Assert.IsNull(view.Data); + // Assert + Assert.IsNull(view.Data); + } } [Test] public void Data_OtherObject_ThrowsInvalidCastException() { // Setup - var view = new LegendView(); + using (var view = new LegendView()) + { + // Call + TestDelegate test = () => view.Data = new object(); - // Call - TestDelegate test = () => view.Data = new object(); - - // Assert - Assert.Throws(test); + // Assert + Assert.Throws(test); + } } } } \ No newline at end of file Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LineDataTreeNodeInfoTest.cs =================================================================== diff -u -ra1de055e3698f610875e623d39f4526970568cef -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LineDataTreeNodeInfoTest.cs (.../LineDataTreeNodeInfoTest.cs) (revision a1de055e3698f610875e623d39f4526970568cef) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/LineDataTreeNodeInfoTest.cs (.../LineDataTreeNodeInfoTest.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -32,6 +32,12 @@ info = treeNodeInfoLookup[typeof(LineData)]; } + [TearDown] + public void TearDown() + { + legendView.Dispose(); + } + [Test] public void Initialized_Always_ExpectedPropertiesSet() { Index: Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/PointDataTreeNodeInfoTest.cs =================================================================== diff -u -ra1de055e3698f610875e623d39f4526970568cef -r249fd5e4604012895724a9d7df67201332c9e7dc --- Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/PointDataTreeNodeInfoTest.cs (.../PointDataTreeNodeInfoTest.cs) (revision a1de055e3698f610875e623d39f4526970568cef) +++ Core/Plugins/test/Core.Plugins.OxyPlot.Test/Legend/PointDataTreeNodeInfoTest.cs (.../PointDataTreeNodeInfoTest.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -32,6 +32,12 @@ info = treeNodeInfoLookup[typeof(PointData)]; } + [TearDown] + public void TearDown() + { + legendView.Dispose(); + } + [Test] public void Initialized_Always_ExpectedPropertiesSet() { Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs =================================================================== diff -u -rc8848af0c6f8780634dcce2013e606f090da6577 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c8848af0c6f8780634dcce2013e606f090da6577) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -104,5 +104,23 @@ return ResourceManager.GetString("FailureMechanism_SectionDevisions_DisplayName", resourceCulture); } } + + /// + /// Looks up a localized string similar to De geometrie die opgegeven werd voor de referentielijn heeft geen waarde.. + /// + public static string ReferenceLine_SetGeometry_New_geometry_cannot_be_null { + get { + return ResourceManager.GetString("ReferenceLine_SetGeometry_New_geometry_cannot_be_null", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Een punt in de geometrie voor de referentielijn heeft geen waarde.. + /// + public static string ReferenceLine_SetGeometry_New_geometry_has_null_coordinate { + get { + return ResourceManager.GetString("ReferenceLine_SetGeometry_New_geometry_has_null_coordinate", resourceCulture); + } + } } } Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx =================================================================== diff -u -r83aacc6578d82137751a7d28f691e8b3d02312f1 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision 83aacc6578d82137751a7d28f691e8b3d02312f1) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -132,4 +132,10 @@ Vakindeling + + De geometrie die opgegeven werd voor de referentielijn heeft geen waarde. + + + Een punt in de geometrie voor de referentielijn heeft geen waarde. + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/ReferenceLine.cs =================================================================== diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Common/src/Ringtoets.Common.Data/ReferenceLine.cs (.../ReferenceLine.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9) +++ Ringtoets/Common/src/Ringtoets.Common.Data/ReferenceLine.cs (.../ReferenceLine.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -25,10 +25,8 @@ using Core.Common.Base.Geometry; -using Ringtoets.Common.Data.Properties; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; -using Resources = Core.Common.Base.Properties.Resources; - namespace Ringtoets.Common.Data { /// @@ -58,12 +56,12 @@ { if (newPoints == null) { - throw new ArgumentNullException("newPoints", Resources.ReferenceLine_SetGeometry_New_geometry_cannot_be_null); + throw new ArgumentNullException("newPoints", RingtoetsCommonDataResources.ReferenceLine_SetGeometry_New_geometry_cannot_be_null); } Point2D[] point2Ds = newPoints.ToArray(); if (point2Ds.Any(p => p == null)) { - throw new ArgumentException(Resources.ReferenceLine_SetGeometry_New_geometry_has_null_coordinate, "newPoints"); + throw new ArgumentException(RingtoetsCommonDataResources.ReferenceLine_SetGeometry_New_geometry_has_null_coordinate, "newPoints"); } Points = point2Ds; Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs =================================================================== diff -u -reb0fa1ad33501642b7cd6c7639155f9f83fd50b4 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision eb0fa1ad33501642b7cd6c7639155f9f83fd50b4) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -59,5 +59,23 @@ resourceCulture = value; } } + + /// + /// Looks up a localized string similar to Bestand bevat 1 multi-polylijn, welke niet ondersteund is.. + /// + internal static string ReferenceLineReader_File_contains_unsupported_multi_polyline { + get { + return ResourceManager.GetString("ReferenceLineReader_File_contains_unsupported_multi_polyline", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bestand moet exact 1 gehele polylijn bevatten.. + /// + internal static string ReferenceLineReader_File_must_contain_1_polyline { + get { + return ResourceManager.GetString("ReferenceLineReader_File_must_contain_1_polyline", resourceCulture); + } + } } } Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx =================================================================== diff -u -reb0fa1ad33501642b7cd6c7639155f9f83fd50b4 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision eb0fa1ad33501642b7cd6c7639155f9f83fd50b4) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -1,101 +1,126 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Bestand bevat 1 multi-polylijn, welke niet ondersteund is. + + + Bestand moet exact 1 gehele polylijn bevatten. + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLineReader.cs =================================================================== diff -u -reb0fa1ad33501642b7cd6c7639155f9f83fd50b4 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLineReader.cs (.../ReferenceLineReader.cs) (revision eb0fa1ad33501642b7cd6c7639155f9f83fd50b4) +++ Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLineReader.cs (.../ReferenceLineReader.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -24,7 +24,6 @@ using System.Linq; using Core.Common.Base.Geometry; -using Core.Common.Base.Properties; using Core.Common.IO.Exceptions; using Core.Common.Utils; using Core.Common.Utils.Builders; @@ -34,6 +33,7 @@ using Ringtoets.Common.Data; using CoreCommonUtilsResources = Core.Common.Utils.Properties.Resources; +using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources; namespace Ringtoets.Common.IO { @@ -88,7 +88,7 @@ catch (CriticalFileReadException e) { string message = new FileReaderErrorMessageBuilder(shapeFilePath) - .Build(Resources.ReferenceLineReader_File_must_contain_1_polyline); + .Build(RingtoetsCommonIOResources.ReferenceLineReader_File_must_contain_1_polyline); throw new CriticalFileReadException(message, e); } } @@ -111,7 +111,7 @@ if (lineShapeReader.GetNumberOfLines() != 1) { string message = new FileReaderErrorMessageBuilder(shapeFilePath) - .Build(Resources.ReferenceLineReader_File_must_contain_1_polyline); + .Build(RingtoetsCommonIOResources.ReferenceLineReader_File_must_contain_1_polyline); throw new CriticalFileReadException(message); } @@ -122,7 +122,7 @@ catch (ElementReadException e) { string message = new FileReaderErrorMessageBuilder(shapeFilePath) - .Build(Resources.ReferenceLineReader_File_contains_unsupported_multi_polyline); + .Build(RingtoetsCommonIOResources.ReferenceLineReader_File_contains_unsupported_multi_polyline); throw new CriticalFileReadException(message, e); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r98fc85d8cecf9edae9fe7c1f2f47b60ecda5e187 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 98fc85d8cecf9edae9fe7c1f2f47b60ecda5e187) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -207,15 +207,6 @@ } /// - /// Looks up a localized string similar to Referentielijn. - /// - public static string ReferenceLine_DisplayName { - get { - return ResourceManager.GetString("ReferenceLine_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Dijken - Steenbekledingen. /// public static string StoneRevetmentFailureMechanism_DisplayName { Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.resx =================================================================== diff -u -r5e0721f34fbf44e8aad51cfd4ff6abc8aa061494 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.resx (.../Resources.resx) (revision 5e0721f34fbf44e8aad51cfd4ff6abc8aa061494) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.resx (.../Resources.resx) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -120,9 +120,6 @@ Duintraject - - Referentielijn - Faalkansverdeling Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/ReferenceLineContext.cs =================================================================== diff -u -r17574077c6720e02c10f23ac3a0354db35855a05 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/ReferenceLineContext.cs (.../ReferenceLineContext.cs) (revision 17574077c6720e02c10f23ac3a0354db35855a05) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/ReferenceLineContext.cs (.../ReferenceLineContext.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -19,35 +19,87 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; + +using Core.Common.Base; + using Ringtoets.Common.Data; using Ringtoets.Integration.Data; +using Ringtoets.Integration.Forms.Properties; namespace Ringtoets.Integration.Forms.PresentationObjects { /// /// Presentation object for instances. /// - public class ReferenceLineContext + public class ReferenceLineContext : Observable, IEquatable { /// /// Initializes a new instance of the class. /// - /// The reference line. - /// The parent owner of . - public ReferenceLineContext(ReferenceLine referenceLine, AssessmentSectionBase parent) + /// The parent owner of the data represented by the presentation object. + public ReferenceLineContext(AssessmentSectionBase parent) { - WrappedData = referenceLine; + if (parent == null) + { + throw new ArgumentNullException("parent", Resources.ReferenceLineContext_Parent_assessment_section_cannot_be_null); + } Parent = parent; } /// /// The reference line data wrapped by this presentation object. /// - public ReferenceLine WrappedData { get; private set; } + public ReferenceLine WrappedData + { + get + { + return Parent.ReferenceLine; + } + } /// /// The assessment section owning . /// public AssessmentSectionBase Parent { get; private set; } + + #region Implementation: IEquatable + + public bool Equals(ReferenceLineContext other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + if (ReferenceEquals(this, other)) + { + return true; + } + return Parent.Equals(other.Parent); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((ReferenceLineContext)obj); + } + + public override int GetHashCode() + { + return Parent.GetHashCode(); + } + + #endregion } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r17574077c6720e02c10f23ac3a0354db35855a05 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 17574077c6720e02c10f23ac3a0354db35855a05) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -164,6 +164,24 @@ } /// + /// Looks up a localized string similar to Referentielijn. + /// + internal static string ReferenceLine_DisplayName { + get { + return ResourceManager.GetString("ReferenceLine_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kan geen presentatie object maken voor een referentielijn zonder een traject als eigenaar.. + /// + internal static string ReferenceLineContext_Parent_assessment_section_cannot_be_null { + get { + return ResourceManager.GetString("ReferenceLineContext_Parent_assessment_section_cannot_be_null", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap ReferenceLineIcon { Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r17574077c6720e02c10f23ac3a0354db35855a05 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 17574077c6720e02c10f23ac3a0354db35855a05) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -154,4 +154,10 @@ ..\Resources\chart_single_line.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Referentielijn + + + Kan geen presentatie object maken voor een referentielijn zonder een traject als eigenaar. + \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ReferenceLineImporter.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ReferenceLineImporter.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ReferenceLineImporter.cs (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -0,0 +1,122 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Drawing; + +using Core.Common.Base.IO; +using Core.Common.IO.Exceptions; + +using log4net; + +using Ringtoets.Common.Data; +using Ringtoets.Common.IO; +using Ringtoets.Integration.Data; +using Ringtoets.Integration.Forms.PresentationObjects; +using Ringtoets.Integration.Plugin.Properties; + +using RingtoetsFormsResources = Ringtoets.Common.Forms.Properties.Resources; +using RingtoetsIntegrationFormsResources = Ringtoets.Integration.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Plugin.FileImporters +{ + /// + /// Imports a and stores in on a , + /// taking data from a shapefile containing a single polyline. + /// + public class ReferenceLineImporter : IFileImporter + { + private static readonly ILog log = LogManager.GetLogger(typeof(ReferenceLineImporter)); + + public string Name + { + get + { + return RingtoetsIntegrationFormsResources.ReferenceLine_DisplayName; + } + } + + public string Category + { + get + { + return RingtoetsFormsResources.Ringtoets_Category; + } + } + + public Bitmap Image + { + get + { + return RingtoetsIntegrationFormsResources.ReferenceLineIcon; + } + } + + public Type SupportedItemType + { + get + { + return typeof(ReferenceLineContext); + } + } + + public string FileFilter + { + get + { + return String.Format("{0} shapefile (*.shp)|*.shp", + RingtoetsIntegrationFormsResources.ReferenceLine_DisplayName); + } + } + + public ProgressChangedDelegate ProgressChanged { get; set; } + + public bool Import(object targetItem, string filePath) + { + try + { + var importTarget = (ReferenceLineContext)targetItem; + var importedReferenceLine = new ReferenceLineReader().ReadReferenceLine(filePath); + importTarget.Parent.ReferenceLine = importedReferenceLine; + return true; + } + catch (ArgumentException e) + { + HandleCriticalFileReadError(e); + return false; + } + catch (CriticalFileReadException e) + { + HandleCriticalFileReadError(e); + return false; + } + } + + public void Cancel() {} + + private static void HandleCriticalFileReadError(Exception e) + { + var errorMessage = String.Format(Resources.ReferenceLineImporter_HandleCriticalFileReadError_Error_0_no_referenceline_imported, + e.Message); + log.Error(errorMessage); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -0,0 +1,74 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Integration.Plugin.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.Integration.Plugin.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to {0} + ///Er is geen referentielijn geïmporteerd.. + /// + internal static string ReferenceLineImporter_HandleCriticalFileReadError_Error_0_no_referenceline_imported { + get { + return ResourceManager.GetString("ReferenceLineImporter_HandleCriticalFileReadError_Error_0_no_referenceline_import" + + "ed", resourceCulture); + } + } + } +} Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + {0} +Er is geen referentielijn geïmporteerd. + + \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj =================================================================== diff -u -r0e38a0bec888061e747359412a17f97ff1f7e422 -r249fd5e4604012895724a9d7df67201332c9e7dc --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision 0e38a0bec888061e747359412a17f97ff1f7e422) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision 249fd5e4604012895724a9d7df67201332c9e7dc) @@ -55,7 +55,13 @@ Properties\GlobalAssembly.cs + + + True + True + Resources.resx + @@ -108,6 +114,10 @@ Ringtoets.Common.Forms False + + {52ba7627-cbab-4209-be77-3b5f31378277} + Ringtoets.Common.IO + {e38c11e0-4384-44dd-9f5b-ee73d79fd7f5} Ringtoets.Common.Placeholder @@ -153,6 +163,12 @@ + + + ResXFileCodeGenerator + Resources.Designer.cs + +