/// <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)
            {
                IProvidedRole providedRoleItem = item.As <IProvidedRole>();

                if (((providedRoleItem != null) &&
                     this._parent.ProvidedRoles_InterfaceProvidingEntity.Remove(providedRoleItem)))
                {
                    return(true);
                }
                IRequiredRole requiredRoleItem = item.As <IRequiredRole>();

                if (((requiredRoleItem != null) &&
                     this._parent.RequiredRoles_InterfaceRequiringEntity.Remove(requiredRoleItem)))
                {
                    return(true);
                }
                IResourceRequiredRole resourceRequiredRoleItem = item.As <IResourceRequiredRole>();

                if (((resourceRequiredRoleItem != null) &&
                     this._parent.ResourceRequiredRoles__ResourceInterfaceRequiringEntity.Remove(resourceRequiredRoleItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #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)
 {
     if ((this._parent.AssemblyContext__RequiredResourceDelegationConnector == null))
     {
         IAssemblyContext assemblyContext__RequiredResourceDelegationConnectorCasted = item.As <IAssemblyContext>();
         if ((assemblyContext__RequiredResourceDelegationConnectorCasted != null))
         {
             this._parent.AssemblyContext__RequiredResourceDelegationConnector = assemblyContext__RequiredResourceDelegationConnectorCasted;
             return;
         }
     }
     if ((this._parent.InnerRequiredRole__RequiredResourceDelegationConnector == null))
     {
         IResourceRequiredRole innerRequiredRole__RequiredResourceDelegationConnectorCasted = item.As <IResourceRequiredRole>();
         if ((innerRequiredRole__RequiredResourceDelegationConnectorCasted != null))
         {
             this._parent.InnerRequiredRole__RequiredResourceDelegationConnector = innerRequiredRole__RequiredResourceDelegationConnectorCasted;
             return;
         }
     }
     if ((this._parent.OuterRequiredRole__RequiredResourceDelegationConnector == null))
     {
         IResourceRequiredRole outerRequiredRole__RequiredResourceDelegationConnectorCasted = item.As <IResourceRequiredRole>();
         if ((outerRequiredRole__RequiredResourceDelegationConnectorCasted != null))
         {
             this._parent.OuterRequiredRole__RequiredResourceDelegationConnector = outerRequiredRole__RequiredResourceDelegationConnectorCasted;
             return;
         }
     }
 }
Example #3
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.InnerResourceRequiredRole_ResourceRequiredDelegationConnector == null))
     {
         IResourceRequiredRole innerResourceRequiredRole_ResourceRequiredDelegationConnectorCasted = item.As <IResourceRequiredRole>();
         if ((innerResourceRequiredRole_ResourceRequiredDelegationConnectorCasted != null))
         {
             this._parent.InnerResourceRequiredRole_ResourceRequiredDelegationConnector = innerResourceRequiredRole_ResourceRequiredDelegationConnectorCasted;
             return;
         }
     }
     if ((this._parent.OuterResourceRequiredRole_ResourceRequiredDelegationConnector == null))
     {
         IResourceRequiredRole outerResourceRequiredRole_ResourceRequiredDelegationConnectorCasted = item.As <IResourceRequiredRole>();
         if ((outerResourceRequiredRole_ResourceRequiredDelegationConnectorCasted != null))
         {
             this._parent.OuterResourceRequiredRole_ResourceRequiredDelegationConnector = outerResourceRequiredRole_ResourceRequiredDelegationConnectorCasted;
             return;
         }
     }
     if ((this._parent.ParentStructure_ResourceRequiredDelegationConnector == null))
     {
         IComposedStructure parentStructure_ResourceRequiredDelegationConnectorCasted = item.As <IComposedStructure>();
         if ((parentStructure_ResourceRequiredDelegationConnectorCasted != null))
         {
             this._parent.ParentStructure_ResourceRequiredDelegationConnector = parentStructure_ResourceRequiredDelegationConnectorCasted;
             return;
         }
     }
 }
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IResourceRequiredRole resourceRequiredRoles__ResourceInterfaceRequiringEntityCasted = item.As <IResourceRequiredRole>();

                if ((resourceRequiredRoles__ResourceInterfaceRequiringEntityCasted != null))
                {
                    this._parent.ResourceRequiredRoles__ResourceInterfaceRequiringEntity.Add(resourceRequiredRoles__ResourceInterfaceRequiringEntityCasted);
                }
            }
Example #5
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.Action__ResourceCall == null))
     {
         IAbstractInternalControlFlowAction action__ResourceCallCasted = item.As <IAbstractInternalControlFlowAction>();
         if ((action__ResourceCallCasted != null))
         {
             this._parent.Action__ResourceCall = action__ResourceCallCasted;
             return;
         }
     }
     if ((this._parent.ResourceRequiredRole__ResourceCall == null))
     {
         IResourceRequiredRole resourceRequiredRole__ResourceCallCasted = item.As <IResourceRequiredRole>();
         if ((resourceRequiredRole__ResourceCallCasted != null))
         {
             this._parent.ResourceRequiredRole__ResourceCall = resourceRequiredRole__ResourceCallCasted;
             return;
         }
     }
     if ((this._parent.Signature__ResourceCall == null))
     {
         IResourceSignature signature__ResourceCallCasted = item.As <IResourceSignature>();
         if ((signature__ResourceCallCasted != null))
         {
             this._parent.Signature__ResourceCall = signature__ResourceCallCasted;
             return;
         }
     }
     if ((this._parent.NumberOfCalls__ResourceCall == null))
     {
         IPCMRandomVariable numberOfCalls__ResourceCallCasted = item.As <IPCMRandomVariable>();
         if ((numberOfCalls__ResourceCallCasted != null))
         {
             this._parent.NumberOfCalls__ResourceCall = numberOfCalls__ResourceCallCasted;
             return;
         }
     }
 }