using System; using System.Diagnostics; using System.Runtime.Serialization; using Deltares.Geotechnics; using Deltares.Stability; namespace Deltares.MStab.IO.Classic { [Serializable] public class GeoTextileException : Exception { // // For guidelines regarding the creation of new exception types, see // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp // and // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp // public GeoTextileException() {} public GeoTextileException(string message) : base(message) {} public GeoTextileException(string message, Exception inner) : base(message, inner) {} protected GeoTextileException( SerializationInfo info, StreamingContext context) : base(info, context) {} } internal class GeoTextiles { /// /// Manders Create the geotextile object (In XML reinforcements). /// public void GetGeoTextiles(int handle, StabilityModel stabilityModel) { try { ClassicMStabFunctionDefinitions.MStabGeoTextiles geotextile = null; GetClassicMStab.GetClassicGeoTextiles(handle, ref geotextile); for (int i = 0; i < geotextile.numberOfItems; i++) { var newGeoTextile = new Geotextile(); newGeoTextile.Name = geotextile.geoTextiles[i].geoTextileName; newGeoTextile.EffectiveTensileStrength = geotextile.geoTextiles[i].tensileStrenght; newGeoTextile.ReductionArea = geotextile.geoTextiles[i].reductionZone; newGeoTextile.StartX = geotextile.geoTextiles[i].xStart; newGeoTextile.StartZ = geotextile.geoTextiles[i].yStart; newGeoTextile.EndX = geotextile.geoTextiles[i].xEnd; newGeoTextile.EndZ = geotextile.geoTextiles[i].yEnd; stabilityModel.Geotextiles.Add(newGeoTextile); } } catch (GeoTextileException e) { Debug.Assert(false, e.ToString()); } } } }