/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IMarket marketsCasted = item.As <IMarket>(); if ((marketsCasted != null)) { this._parent.Markets.Add(marketsCasted); } ISecurityConstraints securityConstraintsCasted = item.As <ISecurityConstraints>(); if ((securityConstraintsCasted != null)) { this._parent.SecurityConstraints.Add(securityConstraintsCasted); } IResourceGroupReq resourceGroupReqsCasted = item.As <IResourceGroupReq>(); if ((resourceGroupReqsCasted != null)) { this._parent.ResourceGroupReqs.Add(resourceGroupReqsCasted); } ISecurityConstraintSum securityConstraintsLinearCasted = item.As <ISecurityConstraintSum>(); if ((securityConstraintsLinearCasted != null)) { this._parent.SecurityConstraintsLinear.Add(securityConstraintsLinearCasted); } IPnode pnodesCasted = item.As <IPnode>(); if ((pnodesCasted != null)) { this._parent.Pnodes.Add(pnodesCasted); } }
/// <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.EnergyPriceCurve == null)) { IEnergyPriceCurve energyPriceCurveCasted = item.As <IEnergyPriceCurve>(); if ((energyPriceCurveCasted != null)) { this._parent.EnergyPriceCurve = energyPriceCurveCasted; return; } } IPnode pnodesCasted = item.As <IPnode>(); if ((pnodesCasted != null)) { this._parent.Pnodes.Add(pnodesCasted); } if ((this._parent.Flowgate == null)) { IFlowgate flowgateCasted = item.As <IFlowgate>(); if ((flowgateCasted != null)) { this._parent.Flowgate = flowgateCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IEnergyProfile energyProfilesCasted = item.As <IEnergyProfile>(); if ((energyProfilesCasted != null)) { this._parent.EnergyProfiles.Add(energyProfilesCasted); } if ((this._parent.Delivery_Pnode == null)) { IPnode delivery_PnodeCasted = item.As <IPnode>(); if ((delivery_PnodeCasted != null)) { this._parent.Delivery_Pnode = delivery_PnodeCasted; return; } } if ((this._parent.Receipt_Pnode == null)) { IPnode receipt_PnodeCasted = item.As <IPnode>(); if ((receipt_PnodeCasted != null)) { this._parent.Receipt_Pnode = receipt_PnodeCasted; 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.ConnectivityNodeContainer == null)) { IConnectivityNodeContainer connectivityNodeContainerCasted = item.As <IConnectivityNodeContainer>(); if ((connectivityNodeContainerCasted != null)) { this._parent.ConnectivityNodeContainer = connectivityNodeContainerCasted; return; } } if ((this._parent.TopologicalNode == null)) { ITopologicalNode topologicalNodeCasted = item.As <ITopologicalNode>(); if ((topologicalNodeCasted != null)) { this._parent.TopologicalNode = topologicalNodeCasted; return; } } if ((this._parent.BusNameMarker == null)) { IBusNameMarker busNameMarkerCasted = item.As <IBusNameMarker>(); if ((busNameMarkerCasted != null)) { this._parent.BusNameMarker = busNameMarkerCasted; return; } } ILossPenaltyFactor lossPenaltyFactorsCasted = item.As <ILossPenaltyFactor>(); if ((lossPenaltyFactorsCasted != null)) { this._parent.LossPenaltyFactors.Add(lossPenaltyFactorsCasted); } INodeConstraintTerm nodeConstraintTermsCasted = item.As <INodeConstraintTerm>(); if ((nodeConstraintTermsCasted != null)) { this._parent.NodeConstraintTerms.Add(nodeConstraintTermsCasted); } ITerminal terminalsCasted = item.As <ITerminal>(); if ((terminalsCasted != null)) { this._parent.Terminals.Add(terminalsCasted); } if ((this._parent.Pnode == null)) { IPnode pnodeCasted = item.As <IPnode>(); if ((pnodeCasted != null)) { this._parent.Pnode = pnodeCasted; 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.Pnode == null)) { IPnode pnodeCasted = item.As <IPnode>(); if ((pnodeCasted != null)) { this._parent.Pnode = pnodeCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IMarket marketsCasted = item.As <IMarket>(); if ((marketsCasted != null)) { this._parent.Markets.Add(marketsCasted); } IMarketProduct marketProductsCasted = item.As <IMarketProduct>(); if ((marketProductsCasted != null)) { this._parent.MarketProducts.Add(marketProductsCasted); } IMeter metersCasted = item.As <IMeter>(); if ((metersCasted != null)) { this._parent.Meters.Add(metersCasted); } if ((this._parent.Pnode == null)) { IPnode pnodeCasted = item.As <IPnode>(); if ((pnodeCasted != null)) { this._parent.Pnode = pnodeCasted; return; } } if ((this._parent.Organisation == null)) { IErpOrganisation organisationCasted = item.As <IErpOrganisation>(); if ((organisationCasted != null)) { this._parent.Organisation = organisationCasted; return; } } IResourceGroup resourceGroupsCasted = item.As <IResourceGroup>(); if ((resourceGroupsCasted != null)) { this._parent.ResourceGroups.Add(resourceGroupsCasted); } }
/// <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.EnergyPriceCurve == item)) { this._parent.EnergyPriceCurve = null; return(true); } IPnode pnodeItem = item.As <IPnode>(); if (((pnodeItem != null) && this._parent.Pnodes.Remove(pnodeItem))) { return(true); } if ((this._parent.Flowgate == item)) { this._parent.Flowgate = null; 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) { IMarket marketItem = item.As <IMarket>(); if (((marketItem != null) && this._parent.Markets.Remove(marketItem))) { return(true); } ISecurityConstraints securityConstraintsItem = item.As <ISecurityConstraints>(); if (((securityConstraintsItem != null) && this._parent.SecurityConstraints.Remove(securityConstraintsItem))) { return(true); } IResourceGroupReq resourceGroupReqItem = item.As <IResourceGroupReq>(); if (((resourceGroupReqItem != null) && this._parent.ResourceGroupReqs.Remove(resourceGroupReqItem))) { return(true); } ISecurityConstraintSum securityConstraintSumItem = item.As <ISecurityConstraintSum>(); if (((securityConstraintSumItem != null) && this._parent.SecurityConstraintsLinear.Remove(securityConstraintSumItem))) { return(true); } IPnode pnodeItem = item.As <IPnode>(); if (((pnodeItem != null) && this._parent.Pnodes.Remove(pnodeItem))) { return(true); } return(false); }