/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IOverheadConductorInfo overheadConductorsCasted = item.As <IOverheadConductorInfo>(); if ((overheadConductorsCasted != null)) { this._parent.OverheadConductors.Add(overheadConductorsCasted); } IMountingConnection connectionsCasted = item.As <IMountingConnection>(); if ((connectionsCasted != null)) { this._parent.Connections.Add(connectionsCasted); } }
/// <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) { IOverheadConductorInfo overheadConductorInfoItem = item.As <IOverheadConductorInfo>(); if (((overheadConductorInfoItem != null) && this._parent.OverheadConductors.Remove(overheadConductorInfoItem))) { return(true); } IMountingConnection mountingConnectionItem = item.As <IMountingConnection>(); if (((mountingConnectionItem != null) && this._parent.Connections.Remove(mountingConnectionItem))) { return(true); } return(false); }