/// <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.PlannedOutage == null)) { IPlannedOutage plannedOutageCasted = item.As <IPlannedOutage>(); if ((plannedOutageCasted != null)) { this._parent.PlannedOutage = plannedOutageCasted; return; } } if ((this._parent.PowerSystemResource == null)) { IPowerSystemResource powerSystemResourceCasted = item.As <IPowerSystemResource>(); if ((powerSystemResourceCasted != null)) { this._parent.PowerSystemResource = powerSystemResourceCasted; return; } } ISwitchingOperation switchingOperationsCasted = item.As <ISwitchingOperation>(); if ((switchingOperationsCasted != null)) { this._parent.SwitchingOperations.Add(switchingOperationsCasted); } }
/// <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.PlannedOutage == item)) { this._parent.PlannedOutage = null; return(true); } if ((this._parent.PowerSystemResource == item)) { this._parent.PowerSystemResource = null; return(true); } ISwitchingOperation switchingOperationItem = item.As <ISwitchingOperation>(); if (((switchingOperationItem != null) && this._parent.SwitchingOperations.Remove(switchingOperationItem))) { 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) { ILoadMgmtFunction loadMgmtFunctionItem = item.As <ILoadMgmtFunction>(); if (((loadMgmtFunctionItem != null) && this._parent.LoadMgmtFunctions.Remove(loadMgmtFunctionItem))) { return(true); } IConnectDisconnectFunction connectDisconnectFunctionItem = item.As <IConnectDisconnectFunction>(); if (((connectDisconnectFunctionItem != null) && this._parent.ConnectDisconnectFunctions.Remove(connectDisconnectFunctionItem))) { return(true); } ISwitchingOperation switchingOperationItem = item.As <ISwitchingOperation>(); if (((switchingOperationItem != null) && this._parent.SwitchingOperations.Remove(switchingOperationItem))) { return(true); } ISwitchSchedule switchScheduleItem = item.As <ISwitchSchedule>(); if (((switchScheduleItem != null) && this._parent.SwitchSchedules.Remove(switchScheduleItem))) { return(true); } if ((this._parent.CompositeSwitch == item)) { this._parent.CompositeSwitch = null; 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) { ILoadMgmtFunction loadMgmtFunctionsCasted = item.As <ILoadMgmtFunction>(); if ((loadMgmtFunctionsCasted != null)) { this._parent.LoadMgmtFunctions.Add(loadMgmtFunctionsCasted); } IConnectDisconnectFunction connectDisconnectFunctionsCasted = item.As <IConnectDisconnectFunction>(); if ((connectDisconnectFunctionsCasted != null)) { this._parent.ConnectDisconnectFunctions.Add(connectDisconnectFunctionsCasted); } ISwitchingOperation switchingOperationsCasted = item.As <ISwitchingOperation>(); if ((switchingOperationsCasted != null)) { this._parent.SwitchingOperations.Add(switchingOperationsCasted); } ISwitchSchedule switchSchedulesCasted = item.As <ISwitchSchedule>(); if ((switchSchedulesCasted != null)) { this._parent.SwitchSchedules.Add(switchSchedulesCasted); } if ((this._parent.CompositeSwitch == null)) { ICompositeSwitch compositeSwitchCasted = item.As <ICompositeSwitch>(); if ((compositeSwitchCasted != null)) { this._parent.CompositeSwitch = compositeSwitchCasted; return; } } }
/// <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 NewStateProxy(ISwitchingOperation modelElement) : base(modelElement, "newState") { }