/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IOutageRecord outageRecordsCasted = item.As <IOutageRecord>(); if ((outageRecordsCasted != null)) { this._parent.OutageRecords.Add(outageRecordsCasted); } IOutageStep outageStepsCasted = item.As <IOutageStep>(); if ((outageStepsCasted != null)) { this._parent.OutageSteps.Add(outageStepsCasted); } }
/// <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) { IOutageRecord outageRecordItem = item.As <IOutageRecord>(); if (((outageRecordItem != null) && this._parent.OutageRecords.Remove(outageRecordItem))) { return(true); } IOutageStep outageStepItem = item.As <IOutageStep>(); if (((outageStepItem != null) && this._parent.OutageSteps.Remove(outageStepItem))) { 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; } } if ((this._parent.OutageStep == null)) { IOutageStep outageStepCasted = item.As <IOutageStep>(); if ((outageStepCasted != null)) { this._parent.OutageStep = outageStepCasted; 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.OutageReport == item)) { this._parent.OutageReport = null; return(true); } IOutageStep outageStepItem = item.As <IOutageStep>(); if (((outageStepItem != null) && this._parent.OutageSteps.Remove(outageStepItem))) { return(true); } IOutageCode outageCodeItem = item.As <IOutageCode>(); if (((outageCodeItem != null) && this._parent.OutageCodes.Remove(outageCodeItem))) { 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.OutageReport == null)) { IOutageReport outageReportCasted = item.As <IOutageReport>(); if ((outageReportCasted != null)) { this._parent.OutageReport = outageReportCasted; return; } } IOutageStep outageStepsCasted = item.As <IOutageStep>(); if ((outageStepsCasted != null)) { this._parent.OutageSteps.Add(outageStepsCasted); } IOutageCode outageCodesCasted = item.As <IOutageCode>(); if ((outageCodesCasted != null)) { this._parent.OutageCodes.Add(outageCodesCasted); } }