Ejemplo n.º 1
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)
            {
                IRegisteredLoad registeredLoadItem = item.As <IRegisteredLoad>();

                if (((registeredLoadItem != null) &&
                     this._parent.RegisteredLoads.Remove(registeredLoadItem)))
                {
                    return(true);
                }
                if ((this._parent.SubLoadArea == item))
                {
                    this._parent.SubLoadArea = null;
                    return(true);
                }
                return(false);
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IRegisteredLoad registeredLoadsCasted = item.As <IRegisteredLoad>();

                if ((registeredLoadsCasted != null))
                {
                    this._parent.RegisteredLoads.Add(registeredLoadsCasted);
                }
                if ((this._parent.SubLoadArea == null))
                {
                    ISubLoadArea subLoadAreaCasted = item.As <ISubLoadArea>();
                    if ((subLoadAreaCasted != null))
                    {
                        this._parent.SubLoadArea = subLoadAreaCasted;
                        return;
                    }
                }
            }