Esempio 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)
            {
                ICustomer customerDatasCasted = item.As <ICustomer>();

                if ((customerDatasCasted != null))
                {
                    this._parent.CustomerDatas.Add(customerDatasCasted);
                }
                IOutageSchedule outageSchedulesCasted = item.As <IOutageSchedule>();

                if ((outageSchedulesCasted != null))
                {
                    this._parent.OutageSchedules.Add(outageSchedulesCasted);
                }
            }
Esempio 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)
            {
                ICustomer customerItem = item.As <ICustomer>();

                if (((customerItem != null) &&
                     this._parent.CustomerDatas.Remove(customerItem)))
                {
                    return(true);
                }
                IOutageSchedule outageScheduleItem = item.As <IOutageSchedule>();

                if (((outageScheduleItem != null) &&
                     this._parent.OutageSchedules.Remove(outageScheduleItem)))
                {
                    return(true);
                }
                return(false);
            }
Esempio n. 3
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ISwitch switchesCasted = item.As <ISwitch>();

                if ((switchesCasted != null))
                {
                    this._parent.Switches.Add(switchesCasted);
                }
                if ((this._parent.OutageSchedule == null))
                {
                    IOutageSchedule outageScheduleCasted = item.As <IOutageSchedule>();
                    if ((outageScheduleCasted != null))
                    {
                        this._parent.OutageSchedule = outageScheduleCasted;
                        return;
                    }
                }
            }