/// <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.GmlFeatureStyle == item)) { this._parent.GmlFeatureStyle = null; return(true); } IGmlGeometryStyle gmlGeometryStyleItem = item.As <IGmlGeometryStyle>(); if (((gmlGeometryStyleItem != null) && this._parent.GmlGeometryStyles.Remove(gmlGeometryStyleItem))) { return(true); } IGmlTopologyStyle gmlTopologyStyleItem = item.As <IGmlTopologyStyle>(); if (((gmlTopologyStyleItem != null) && this._parent.GmlTopologyStyles.Remove(gmlTopologyStyleItem))) { 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.GmlFeatureStyle == null)) { IGmlFeatureStyle gmlFeatureStyleCasted = item.As <IGmlFeatureStyle>(); if ((gmlFeatureStyleCasted != null)) { this._parent.GmlFeatureStyle = gmlFeatureStyleCasted; return; } } IGmlGeometryStyle gmlGeometryStylesCasted = item.As <IGmlGeometryStyle>(); if ((gmlGeometryStylesCasted != null)) { this._parent.GmlGeometryStyles.Add(gmlGeometryStylesCasted); } IGmlTopologyStyle gmlTopologyStylesCasted = item.As <IGmlTopologyStyle>(); if ((gmlTopologyStylesCasted != null)) { this._parent.GmlTopologyStyles.Add(gmlTopologyStylesCasted); } }