BesAsm.Swsp.PacSizingTool.SlopedFacility.DeleteSegment C# (CSharp) Method

DeleteSegment() public method

Removes a segment from the facility.
public DeleteSegment ( SlopedFacilitySegment segment ) : void
segment SlopedFacilitySegment The segment to delete.
return void
        public void DeleteSegment(SlopedFacilitySegment segment)
        {
            if (_segments.Contains(segment))
            _segments.Remove(segment);
        }

Usage Example

Example #1
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            try
            {
                //Create a new segment
                SlopedFacilitySegment segment = new SlopedFacilitySegment();

                //Assign values to segment. All segments have these fields:
                segment.SegmentLengthFt     = 10;
                segment.CheckDamLengthFt    = 2;
                segment.SlopeRatio          = 0.02;
                segment.SideSlopeRightRatio = 4;
                segment.SideSlopeLeftRatio  = 4;
                segment.DownstreamDepthIn   = 9;
                segment.LandscapeWidthFt    = 2;

                segment.RockStorageWidthFt = 4; //Only facility types with rock galleries use this field; see parameter matrix for details

                //Create a catchment, no change for sloped facilities
                Catchment catchment = new Catchment("Test Catchment");

                //Create a SlopedFacility object, constructed the same way as a standard facility
                SlopedFacility facility = new SlopedFacility(FacilityType.Swale, FacilityConfiguration.A, catchment);

                //Segments can be added or deleted from the sloped facility.
                facility.AddSegment(segment);

                facility.DeleteSegment(segment);



                PerformCalculations();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
        }
All Usage Examples Of BesAsm.Swsp.PacSizingTool.SlopedFacility::DeleteSegment