/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ITrackElement elementsCasted = item.As <ITrackElement>(); if ((elementsCasted != null)) { this._parent.Elements.Add(elementsCasted); } }
/// <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) { ITrackElement trackElementItem = item.As <ITrackElement>(); if (((trackElementItem != null) && this._parent.Elements.Remove(trackElementItem))) { return(true); } return(false); }
/// <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) { if ((this._parent.Sensor == item)) { this._parent.Sensor = null; return(true); } ITrackElement trackElementItem = item.As <ITrackElement>(); if (((trackElementItem != null) && this._parent.ConnectsTo.Remove(trackElementItem))) { return(true); } return(false); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { if ((this._parent.Sensor == null)) { ISensor sensorCasted = item.As <ISensor>(); if ((sensorCasted != null)) { this._parent.Sensor = sensorCasted; return; } } ITrackElement connectsToCasted = item.As <ITrackElement>(); if ((connectsToCasted != null)) { this._parent.ConnectsTo.Add(connectsToCasted); } }