/// <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) { IGmlGraphic gmlGraphicItem = item.As <IGmlGraphic>(); if (((gmlGraphicItem != null) && this._parent.GmlGraphics.Remove(gmlGraphicItem))) { return(true); } IGmlFill gmlFillItem = item.As <IGmlFill>(); if (((gmlFillItem != null) && this._parent.GmlFIlls.Remove(gmlFillItem))) { return(true); } IGmlStroke gmlStrokeItem = item.As <IGmlStroke>(); if (((gmlStrokeItem != null) && this._parent.GmlStrokes.Remove(gmlStrokeItem))) { 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.GmlGraphic == null)) { IGmlGraphic gmlGraphicCasted = item.As <IGmlGraphic>(); if ((gmlGraphicCasted != null)) { this._parent.GmlGraphic = gmlGraphicCasted; return; } } if ((this._parent.GmlDiagramObject == null)) { IGmlDiagramObject gmlDiagramObjectCasted = item.As <IGmlDiagramObject>(); if ((gmlDiagramObjectCasted != null)) { this._parent.GmlDiagramObject = gmlDiagramObjectCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IGmlGraphic gmlGraphicsCasted = item.As <IGmlGraphic>(); if ((gmlGraphicsCasted != null)) { this._parent.GmlGraphics.Add(gmlGraphicsCasted); } IGmlFill gmlFIllsCasted = item.As <IGmlFill>(); if ((gmlFIllsCasted != null)) { this._parent.GmlFIlls.Add(gmlFIllsCasted); } IGmlStroke gmlStrokesCasted = item.As <IGmlStroke>(); if ((gmlStrokesCasted != null)) { this._parent.GmlStrokes.Add(gmlStrokesCasted); } }