/// <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.MountingPoint == null)) { IMountingPoint mountingPointCasted = item.As <IMountingPoint>(); if ((mountingPointCasted != null)) { this._parent.MountingPoint = mountingPointCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IStructureInfo structureInfosCasted = item.As <IStructureInfo>(); if ((structureInfosCasted != null)) { this._parent.StructureInfos.Add(structureInfosCasted); } IMountingPoint mountingPointsCasted = item.As <IMountingPoint>(); if ((mountingPointsCasted != null)) { this._parent.MountingPoints.Add(mountingPointsCasted); } }
/// <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) { IStructureInfo structureInfoItem = item.As <IStructureInfo>(); if (((structureInfoItem != null) && this._parent.StructureInfos.Remove(structureInfoItem))) { return(true); } IMountingPoint mountingPointItem = item.As <IMountingPoint>(); if (((mountingPointItem != null) && this._parent.MountingPoints.Remove(mountingPointItem))) { return(true); } return(false); }
/// <summary> /// Creates a new observable property access proxy /// </summary> /// <param name="modelElement">The model instance element for which to create the property access proxy</param> public PhaseCodeProxy(IMountingPoint modelElement) : base(modelElement, "phaseCode") { }