PurplePen.EventDB.RemoveLeg C# (CSharp) Method

RemoveLeg() public method

public RemoveLeg ( Id id ) : void
id Id
return void
        public void RemoveLeg(Id<Leg> id)
        {
            legStore.Remove(id);
        }

Usage Example

Example #1
0
        // Change the gaps associated with a leg.
        public static void ChangeLegGaps(EventDB eventDB, Id<ControlPoint> controlId1, Id<ControlPoint> controlId2, LegGap[] newGaps)
        {
            // Get the leg object for this leg. Create one if needed.
            Id<Leg> legId = QueryEvent.FindLeg(eventDB, controlId1, controlId2);
            Leg leg;
            if (legId.IsNone)
                leg = new Leg(controlId1, controlId2);
            else
                leg = (Leg) eventDB.GetLeg(legId).Clone();

            // Change the gaps.
            leg.gaps = (newGaps == null) ? null : (LegGap[]) newGaps.Clone();

            // Write the change leg object to the event DB. If the leg is vacuous, could involve removing the leg.
            if (leg.IsVacuous()) {
                if (legId.IsNotNone)
                    eventDB.RemoveLeg(legId);
            }
            else {
                if (legId.IsNone)
                    eventDB.AddLeg(leg);
                else
                    eventDB.ReplaceLeg(legId, leg);
            }
        }
All Usage Examples Of PurplePen.EventDB::RemoveLeg