Exemplo n.º 1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                INonConformLoadSchedule nonConformLoadSchedulesCasted = item.As <INonConformLoadSchedule>();

                if ((nonConformLoadSchedulesCasted != null))
                {
                    this._parent.NonConformLoadSchedules.Add(nonConformLoadSchedulesCasted);
                }
                INonConformLoad energyConsumersCasted = item.As <INonConformLoad>();

                if ((energyConsumersCasted != null))
                {
                    this._parent.EnergyConsumers.Add(energyConsumersCasted);
                }
            }
Exemplo n.º 2
0
            /// <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)
            {
                INonConformLoadSchedule nonConformLoadScheduleItem = item.As <INonConformLoadSchedule>();

                if (((nonConformLoadScheduleItem != null) &&
                     this._parent.NonConformLoadSchedules.Remove(nonConformLoadScheduleItem)))
                {
                    return(true);
                }
                INonConformLoad nonConformLoadItem = item.As <INonConformLoad>();

                if (((nonConformLoadItem != null) &&
                     this._parent.EnergyConsumers.Remove(nonConformLoadItem)))
                {
                    return(true);
                }
                return(false);
            }