/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IConformLoad energyConsumersCasted = item.As <IConformLoad>(); if ((energyConsumersCasted != null)) { this._parent.EnergyConsumers.Add(energyConsumersCasted); } IConformLoadSchedule conformLoadSchedulesCasted = item.As <IConformLoadSchedule>(); if ((conformLoadSchedulesCasted != null)) { this._parent.ConformLoadSchedules.Add(conformLoadSchedulesCasted); } }
/// <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) { IConformLoad conformLoadItem = item.As <IConformLoad>(); if (((conformLoadItem != null) && this._parent.EnergyConsumers.Remove(conformLoadItem))) { return(true); } IConformLoadSchedule conformLoadScheduleItem = item.As <IConformLoadSchedule>(); if (((conformLoadScheduleItem != null) && this._parent.ConformLoadSchedules.Remove(conformLoadScheduleItem))) { return(true); } return(false); }