/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IDistributionLineSegment conductorSegmentsCasted = item.As <IDistributionLineSegment>(); if ((conductorSegmentsCasted != null)) { this._parent.ConductorSegments.Add(conductorSegmentsCasted); } IPhaseImpedanceData phaseImpedanceDataCasted = item.As <IPhaseImpedanceData>(); if ((phaseImpedanceDataCasted != null)) { this._parent.PhaseImpedanceData.Add(phaseImpedanceDataCasted); } }
/// <summary> /// Removes the given item from the collection /// </summary> /// <returns>True, if the item was removed, otherwise False</returns> /// <param name="item">The item that should be removed</param> public override bool Remove(IModelElement item) { IDistributionLineSegment distributionLineSegmentItem = item.As <IDistributionLineSegment>(); if (((distributionLineSegmentItem != null) && this._parent.ConductorSegments.Remove(distributionLineSegmentItem))) { return(true); } IPhaseImpedanceData phaseImpedanceDataItem = item.As <IPhaseImpedanceData>(); if (((phaseImpedanceDataItem != null) && this._parent.PhaseImpedanceData.Remove(phaseImpedanceDataItem))) { return(true); } return(false); }