Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/SurfaceLineAdapter.cs =================================================================== diff -u -r971 -r1053 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/SurfaceLineAdapter.cs (.../SurfaceLineAdapter.cs) (revision 971) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/SurfaceLineAdapter.cs (.../SurfaceLineAdapter.cs) (revision 1053) @@ -22,10 +22,10 @@ using System; using System.Collections.Generic; using System.Linq; +using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Geotechnics; -using Deltares.DamEngine.Data.Standard.Language; namespace Deltares.DamEngine.Calculators.DikesDesign { @@ -190,7 +190,7 @@ } if (newSlopeEndPoint == null) { - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(this, "SlopeErrorNoIntersection")); + throw new SurfaceLineAdapterException(Resources.SlopeErrorNoIntersection); } var dikeToeAtPolder = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder); if (newSlopeEndPoint.X > dikeToeAtPolder.X) @@ -253,8 +253,7 @@ if (!newSlopeEndPoint.LocationEquals(new Point2D(dikeToeAtPolder.X, dikeToeAtPolder.Z))) { // There is no shoulder so the slope must be too steep. - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(this, - "SlopeErrorNoIntersection")); + throw new SurfaceLineAdapterException(Resources.SlopeErrorNoIntersection); } } } @@ -286,45 +285,39 @@ var zeroPoint = new GeometryPoint(); if (zeroPoint.LocationEquals(p1) || zeroPoint.LocationEquals(p2)) - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterDikeHeightError")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineAdapterDikeHeightError); if (surfaceLine.HasShoulderInside()) { p1 = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); p2 = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderBaseInside); if (zeroPoint.LocationEquals(p1) || zeroPoint.LocationEquals(p2)) - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterShoulderHeightError")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineAdapterShoulderHeightError); } } private static void ThrowWhenSurfaceLineHasAShoulderInsideAndNoSurfaceLevel(SurfaceLine2 surfaceLine, GeometryPoint surfaceLevelPoint) { if (surfaceLine.HasShoulderInside() && surfaceLevelPoint == null) - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterSurfaceLevelError")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineAdapterSurfaceLevelError); } private static void ThrowWhenSurfaceHasNoDike(SurfaceLine2 surfaceLine) { if (!surfaceLine.HasDike()) - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterInvalidDikeError")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineAdapterInvalidDikeError); } private static void ThrowWhenSurfaceLineIsNull(SurfaceLine2 surfaceLine) { if (surfaceLine == null) - throw new ArgumentNullException("SurfaceLine", LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterNoDikeError")); + throw new ArgumentNullException(Resources.SurfaceLineAdapterNoDikeError); } private static void ThrowWhenSurfaceLineHasNoOrLessThenFourPoints(ICollection points) { if (points == null || points.Count < 4) - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterNoDikePointsError")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineAdapterNoDikePointsError); } /// @@ -364,8 +357,7 @@ if (surfaceLine.HasDitch()) { // Incorrect ditch is an error here, this should have been checked already - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterDikeDitchError")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineAdapterDikeDitchError); } } return null; @@ -439,8 +431,7 @@ else { //new slope of ditch does not intersect with surface line (most probably because the bottom is too high) - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(typeof(SurfaceLineAdapter), - "SurfaceLineAdapterDitchSlopeError")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineAdapterDitchSlopeError); } return res; } @@ -492,7 +483,7 @@ double surfaceLevelInsideX = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelInside).X; if (coors.XAtPolder > surfaceLevelInsideX) { - throw new SurfaceLineAdapterException(LocalizationManager.GetTranslatedText(this, "SurfaceLineHeightAdapterDitchOutsideSurfaceLine")); + throw new SurfaceLineAdapterException(Resources.SurfaceLineHeightAdapterDitchOutsideSurfaceLine); } // Add the outside points of the new ditch surfaceLine.EnsurePointOfType(coors.XAtDike, coors.ZAtDike, CharacteristicPointType.DitchDikeSide);