Ejemplo 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)
            {
                ISwitchedTime timesCasted = item.As <ISwitchedTime>();

                if ((timesCasted != null))
                {
                    this._parent.Times.Add(timesCasted);
                }
            }
Ejemplo 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)
            {
                ISwitchedTime switchedTimeItem = item.As <ISwitchedTime>();

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