示例#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)
            {
                IAssemblyContext assemblyContextItem = item.As <IAssemblyContext>();

                if (((assemblyContextItem != null) &&
                     this._parent.AssemblyContexts__ComposedStructure.Remove(assemblyContextItem)))
                {
                    return(true);
                }
                IResourceRequiredDelegationConnector resourceRequiredDelegationConnectorItem = item.As <IResourceRequiredDelegationConnector>();

                if (((resourceRequiredDelegationConnectorItem != null) &&
                     this._parent.ResourceRequiredDelegationConnectors_ComposedStructure.Remove(resourceRequiredDelegationConnectorItem)))
                {
                    return(true);
                }
                IEventChannel eventChannelItem = item.As <IEventChannel>();

                if (((eventChannelItem != null) &&
                     this._parent.EventChannel__ComposedStructure.Remove(eventChannelItem)))
                {
                    return(true);
                }
                IConnector connectorItem = item.As <IConnector>();

                if (((connectorItem != null) &&
                     this._parent.Connectors__ComposedStructure.Remove(connectorItem)))
                {
                    return(true);
                }
                return(false);
            }
示例#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)
            {
                IAssemblyContext assemblyContexts__ComposedStructureCasted = item.As <IAssemblyContext>();

                if ((assemblyContexts__ComposedStructureCasted != null))
                {
                    this._parent.AssemblyContexts__ComposedStructure.Add(assemblyContexts__ComposedStructureCasted);
                }
                IResourceRequiredDelegationConnector resourceRequiredDelegationConnectors_ComposedStructureCasted = item.As <IResourceRequiredDelegationConnector>();

                if ((resourceRequiredDelegationConnectors_ComposedStructureCasted != null))
                {
                    this._parent.ResourceRequiredDelegationConnectors_ComposedStructure.Add(resourceRequiredDelegationConnectors_ComposedStructureCasted);
                }
                IEventChannel eventChannel__ComposedStructureCasted = item.As <IEventChannel>();

                if ((eventChannel__ComposedStructureCasted != null))
                {
                    this._parent.EventChannel__ComposedStructure.Add(eventChannel__ComposedStructureCasted);
                }
                IConnector connectors__ComposedStructureCasted = item.As <IConnector>();

                if ((connectors__ComposedStructureCasted != null))
                {
                    this._parent.Connectors__ComposedStructure.Add(connectors__ComposedStructureCasted);
                }
            }