/// <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) { ITopologicalNode topologicalNodeItem = item.As <ITopologicalNode>(); if (((topologicalNodeItem != null) && this._parent.TopologicalNode.Remove(topologicalNodeItem))) { return(true); } IVoltageLevel voltageLevelItem = item.As <IVoltageLevel>(); if (((voltageLevelItem != null) && this._parent.VoltageLevel.Remove(voltageLevelItem))) { return(true); } IConductingEquipment conductingEquipmentItem = item.As <IConductingEquipment>(); if (((conductingEquipmentItem != null) && this._parent.ConductingEquipment.Remove(conductingEquipmentItem))) { 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.ConductingEquipment == null)) { IConductingEquipment conductingEquipmentCasted = item.As <IConductingEquipment>(); if ((conductingEquipmentCasted != null)) { this._parent.ConductingEquipment = conductingEquipmentCasted; return; } } }
/// <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.ConductingEquipment == null)) { IConductingEquipment conductingEquipmentCasted = item.As <IConductingEquipment>(); if ((conductingEquipmentCasted != null)) { this._parent.ConductingEquipment = conductingEquipmentCasted; return; } } IElectricalInfo electricalInfosCasted = item.As <IElectricalInfo>(); if ((electricalInfosCasted != null)) { this._parent.ElectricalInfos.Add(electricalInfosCasted); } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ITopologicalNode topologicalNodeCasted = item.As <ITopologicalNode>(); if ((topologicalNodeCasted != null)) { this._parent.TopologicalNode.Add(topologicalNodeCasted); } IVoltageLevel voltageLevelCasted = item.As <IVoltageLevel>(); if ((voltageLevelCasted != null)) { this._parent.VoltageLevel.Add(voltageLevelCasted); } IConductingEquipment conductingEquipmentCasted = item.As <IConductingEquipment>(); if ((conductingEquipmentCasted != null)) { this._parent.ConductingEquipment.Add(conductingEquipmentCasted); } }
/// <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) { IConductingEquipment conductingEquipmentItem = item.As <IConductingEquipment>(); if (((conductingEquipmentItem != null) && this._parent.ConductingEquipments.Remove(conductingEquipmentItem))) { return(true); } if ((this._parent.Unit == item)) { this._parent.Unit = null; return(true); } IProtectedSwitch protectedSwitchItem = item.As <IProtectedSwitch>(); if (((protectedSwitchItem != null) && this._parent.ProtectedSwitches.Remove(protectedSwitchItem))) { 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) { IConductingEquipment conductingEquipmentsCasted = item.As <IConductingEquipment>(); if ((conductingEquipmentsCasted != null)) { this._parent.ConductingEquipments.Add(conductingEquipmentsCasted); } if ((this._parent.Unit == null)) { IUnit unitCasted = item.As <IUnit>(); if ((unitCasted != null)) { this._parent.Unit = unitCasted; return; } } IProtectedSwitch protectedSwitchesCasted = item.As <IProtectedSwitch>(); if ((protectedSwitchesCasted != null)) { this._parent.ProtectedSwitches.Add(protectedSwitchesCasted); } }
/// <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 PhasesProxy(IConductingEquipment modelElement) : base(modelElement, "phases") { }