/// <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.GmlDiagramObject == null)) { IGmlDiagramObject gmlDiagramObjectCasted = item.As <IGmlDiagramObject>(); if ((gmlDiagramObjectCasted != null)) { this._parent.GmlDiagramObject = gmlDiagramObjectCasted; return; } } if ((this._parent.GmlStroke == null)) { IGmlStroke gmlStrokeCasted = item.As <IGmlStroke>(); if ((gmlStrokeCasted != null)) { this._parent.GmlStroke = gmlStrokeCasted; return; } } if ((this._parent.GmlFill == null)) { IGmlFill gmlFillCasted = item.As <IGmlFill>(); if ((gmlFillCasted != null)) { this._parent.GmlFill = gmlFillCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IGmlDiagramObject gmlDiagramObjectsCasted = item.As <IGmlDiagramObject>(); if ((gmlDiagramObjectsCasted != null)) { this._parent.GmlDiagramObjects.Add(gmlDiagramObjectsCasted); } IDiagram diagramsCasted = item.As <IDiagram>(); if ((diagramsCasted != null)) { this._parent.Diagrams.Add(diagramsCasted); } if ((this._parent.Location == null)) { ILocation locationCasted = item.As <ILocation>(); if ((locationCasted != null)) { this._parent.Location = locationCasted; return; } } IPositionPoint positionPointsCasted = item.As <IPositionPoint>(); if ((positionPointsCasted != null)) { this._parent.PositionPoints.Add(positionPointsCasted); } }
/// <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) { IGmlDiagramObject gmlDiagramObjectItem = item.As <IGmlDiagramObject>(); if (((gmlDiagramObjectItem != null) && this._parent.GmlDiagramObjects.Remove(gmlDiagramObjectItem))) { return(true); } IDiagram diagramItem = item.As <IDiagram>(); if (((diagramItem != null) && this._parent.Diagrams.Remove(diagramItem))) { return(true); } if ((this._parent.Location == item)) { this._parent.Location = null; return(true); } IPositionPoint positionPointItem = item.As <IPositionPoint>(); if (((positionPointItem != null) && this._parent.PositionPoints.Remove(positionPointItem))) { 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) { IGmlDiagramObject gmlDiagramObjectItem = item.As <IGmlDiagramObject>(); if (((gmlDiagramObjectItem != null) && this._parent.GmlDiagramObjects.Remove(gmlDiagramObjectItem))) { return(true); } IChangeItem changeItemItem = item.As <IChangeItem>(); if (((changeItemItem != null) && this._parent.ChangeItems.Remove(changeItemItem))) { return(true); } IGmlValue gmlValueItem = item.As <IGmlValue>(); if (((gmlValueItem != null) && this._parent.GmlValues.Remove(gmlValueItem))) { 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) { IGmlDiagramObject gmlDiagramObjectsCasted = item.As <IGmlDiagramObject>(); if ((gmlDiagramObjectsCasted != null)) { this._parent.GmlDiagramObjects.Add(gmlDiagramObjectsCasted); } IChangeItem changeItemsCasted = item.As <IChangeItem>(); if ((changeItemsCasted != null)) { this._parent.ChangeItems.Add(changeItemsCasted); } }
/// <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> /// 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.CoordinateSystem == item)) { this._parent.CoordinateSystem = null; return(true); } IGmlDiagramObject gmlDiagramObjectItem = item.As <IGmlDiagramObject>(); if (((gmlDiagramObjectItem != null) && this._parent.GmlDiagramObjects.Remove(gmlDiagramObjectItem))) { return(true); } IDesignLocation designLocationItem = item.As <IDesignLocation>(); if (((designLocationItem != null) && this._parent.DesignLocations.Remove(designLocationItem))) { 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.CoordinateSystem == null)) { ICoordinateSystem coordinateSystemCasted = item.As <ICoordinateSystem>(); if ((coordinateSystemCasted != null)) { this._parent.CoordinateSystem = coordinateSystemCasted; return; } } IGmlDiagramObject gmlDiagramObjectsCasted = item.As <IGmlDiagramObject>(); if ((gmlDiagramObjectsCasted != null)) { this._parent.GmlDiagramObjects.Add(gmlDiagramObjectsCasted); } IDesignLocation designLocationsCasted = item.As <IDesignLocation>(); if ((designLocationsCasted != null)) { this._parent.DesignLocations.Add(designLocationsCasted); } }