Exemple #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)
            {
                IServiceEffectSpecification serviceEffectSpecifications__BasicComponentCasted = item.As <IServiceEffectSpecification>();

                if ((serviceEffectSpecifications__BasicComponentCasted != null))
                {
                    this._parent.ServiceEffectSpecifications__BasicComponent.Add(serviceEffectSpecifications__BasicComponentCasted);
                }
                IPassiveResource passiveResource_BasicComponentCasted = item.As <IPassiveResource>();

                if ((passiveResource_BasicComponentCasted != null))
                {
                    this._parent.PassiveResource_BasicComponent.Add(passiveResource_BasicComponentCasted);
                }
            }
Exemple #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)
            {
                IServiceEffectSpecification serviceEffectSpecificationItem = item.As <IServiceEffectSpecification>();

                if (((serviceEffectSpecificationItem != null) &&
                     this._parent.ServiceEffectSpecifications__BasicComponent.Remove(serviceEffectSpecificationItem)))
                {
                    return(true);
                }
                IPassiveResource passiveResourceItem = item.As <IPassiveResource>();

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