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)
            {
                ICompleteComponentType parentCompleteComponentTypesCasted = item.As <ICompleteComponentType>();

                if ((parentCompleteComponentTypesCasted != null))
                {
                    this._parent.ParentCompleteComponentTypes.Add(parentCompleteComponentTypesCasted);
                }
                IVariableUsage componentParameterUsage_ImplementationComponentTypeCasted = item.As <IVariableUsage>();

                if ((componentParameterUsage_ImplementationComponentTypeCasted != null))
                {
                    this._parent.ComponentParameterUsage_ImplementationComponentType.Add(componentParameterUsage_ImplementationComponentTypeCasted);
                }
            }
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)
            {
                ICompleteComponentType completeComponentTypeItem = item.As <ICompleteComponentType>();

                if (((completeComponentTypeItem != null) &&
                     this._parent.ParentCompleteComponentTypes.Remove(completeComponentTypeItem)))
                {
                    return(true);
                }
                IVariableUsage variableUsageItem = item.As <IVariableUsage>();

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