/// <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.VoltageControlZone == null)) { IVoltageControlZone voltageControlZoneCasted = item.As <IVoltageControlZone>(); if ((voltageControlZoneCasted != null)) { this._parent.VoltageControlZone = voltageControlZoneCasted; 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.RegulatingControl == item)) { this._parent.RegulatingControl = null; return(true); } IVoltageControlZone voltageControlZoneItem = item.As <IVoltageControlZone>(); if (((voltageControlZoneItem != null) && this._parent.VoltageControlZones.Remove(voltageControlZoneItem))) { 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.RegulatingControl == null)) { IRegulatingControl regulatingControlCasted = item.As <IRegulatingControl>(); if ((regulatingControlCasted != null)) { this._parent.RegulatingControl = regulatingControlCasted; return; } } IVoltageControlZone voltageControlZonesCasted = item.As <IVoltageControlZone>(); if ((voltageControlZonesCasted != null)) { this._parent.VoltageControlZones.Add(voltageControlZonesCasted); } }