Exemplo 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)
 {
     if ((this._parent.Specification_ParametericResourceDemand == null))
     {
         IPCMRandomVariable specification_ParametericResourceDemandCasted = item.As <IPCMRandomVariable>();
         if ((specification_ParametericResourceDemandCasted != null))
         {
             this._parent.Specification_ParametericResourceDemand = specification_ParametericResourceDemandCasted;
             return;
         }
     }
     if ((this._parent.RequiredResource_ParametricResourceDemand == null))
     {
         IProcessingResourceType requiredResource_ParametricResourceDemandCasted = item.As <IProcessingResourceType>();
         if ((requiredResource_ParametricResourceDemandCasted != null))
         {
             this._parent.RequiredResource_ParametricResourceDemand = requiredResource_ParametricResourceDemandCasted;
             return;
         }
     }
     if ((this._parent.Action_ParametricResourceDemand == null))
     {
         IAbstractInternalControlFlowAction action_ParametricResourceDemandCasted = item.As <IAbstractInternalControlFlowAction>();
         if ((action_ParametricResourceDemandCasted != null))
         {
             this._parent.Action_ParametricResourceDemand = action_ParametricResourceDemandCasted;
             return;
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets called when the parent model element of the current model element is about to change
        /// </summary>
        /// <param name="oldParent">The old parent model element</param>
        /// <param name="newParent">The new parent model element</param>
        protected override void OnParentChanging(IModelElement newParent, IModelElement oldParent)
        {
            IAbstractInternalControlFlowAction oldAction__InfrastructureCall = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(oldParent);
            IAbstractInternalControlFlowAction newAction__InfrastructureCall = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(newParent);
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldAction__InfrastructureCall, newAction__InfrastructureCall);

            this.OnAction__InfrastructureCallChanging(e);
            this.OnPropertyChanging("Action__InfrastructureCall", e, _action__InfrastructureCallReference);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets called when the parent model element of the current model element is about to change
        /// </summary>
        /// <param name="oldParent">The old parent model element</param>
        /// <param name="newParent">The new parent model element</param>
        protected override void OnParentChanging(IModelElement newParent, IModelElement oldParent)
        {
            IAbstractInternalControlFlowAction oldAction_ParametricResourceDemand = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(oldParent);
            IAbstractInternalControlFlowAction newAction_ParametricResourceDemand = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(newParent);
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldAction_ParametricResourceDemand, newAction_ParametricResourceDemand);

            this.OnAction_ParametricResourceDemandChanging(e);
            this.OnPropertyChanging("Action_ParametricResourceDemand", e, _action_ParametricResourceDemandReference);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets called when the parent model element of the current model element changes
        /// </summary>
        /// <param name="oldParent">The old parent model element</param>
        /// <param name="newParent">The new parent model element</param>
        protected override void OnParentChanged(IModelElement newParent, IModelElement oldParent)
        {
            IAbstractInternalControlFlowAction oldAction__InfrastructureCall = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(oldParent);
            IAbstractInternalControlFlowAction newAction__InfrastructureCall = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(newParent);

            if ((oldAction__InfrastructureCall != null))
            {
                oldAction__InfrastructureCall.InfrastructureCall__Action.Remove(this);
            }
            if ((newAction__InfrastructureCall != null))
            {
                newAction__InfrastructureCall.InfrastructureCall__Action.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldAction__InfrastructureCall, newAction__InfrastructureCall);

            this.OnAction__InfrastructureCallChanged(e);
            this.OnPropertyChanged("Action__InfrastructureCall", e, _action__InfrastructureCallReference);
            base.OnParentChanged(newParent, oldParent);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Gets called when the parent model element of the current model element changes
        /// </summary>
        /// <param name="oldParent">The old parent model element</param>
        /// <param name="newParent">The new parent model element</param>
        protected override void OnParentChanged(IModelElement newParent, IModelElement oldParent)
        {
            IAbstractInternalControlFlowAction oldAction_ParametricResourceDemand = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(oldParent);
            IAbstractInternalControlFlowAction newAction_ParametricResourceDemand = ModelHelper.CastAs <IAbstractInternalControlFlowAction>(newParent);

            if ((oldAction_ParametricResourceDemand != null))
            {
                oldAction_ParametricResourceDemand.ResourceDemand_Action.Remove(this);
            }
            if ((newAction_ParametricResourceDemand != null))
            {
                newAction_ParametricResourceDemand.ResourceDemand_Action.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldAction_ParametricResourceDemand, newAction_ParametricResourceDemand);

            this.OnAction_ParametricResourceDemandChanged(e);
            this.OnPropertyChanged("Action_ParametricResourceDemand", e, _action_ParametricResourceDemandReference);
            base.OnParentChanged(newParent, oldParent);
        }
Exemplo n.º 6
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.Signature__InfrastructureCall == null))
     {
         IInfrastructureSignature signature__InfrastructureCallCasted = item.As <IInfrastructureSignature>();
         if ((signature__InfrastructureCallCasted != null))
         {
             this._parent.Signature__InfrastructureCall = signature__InfrastructureCallCasted;
             return;
         }
     }
     if ((this._parent.NumberOfCalls__InfrastructureCall == null))
     {
         IPCMRandomVariable numberOfCalls__InfrastructureCallCasted = item.As <IPCMRandomVariable>();
         if ((numberOfCalls__InfrastructureCallCasted != null))
         {
             this._parent.NumberOfCalls__InfrastructureCall = numberOfCalls__InfrastructureCallCasted;
             return;
         }
     }
     if ((this._parent.Action__InfrastructureCall == null))
     {
         IAbstractInternalControlFlowAction action__InfrastructureCallCasted = item.As <IAbstractInternalControlFlowAction>();
         if ((action__InfrastructureCallCasted != null))
         {
             this._parent.Action__InfrastructureCall = action__InfrastructureCallCasted;
             return;
         }
     }
     if ((this._parent.RequiredRole__InfrastructureCall == null))
     {
         IInfrastructureRequiredRole requiredRole__InfrastructureCallCasted = item.As <IInfrastructureRequiredRole>();
         if ((requiredRole__InfrastructureCallCasted != null))
         {
             this._parent.RequiredRole__InfrastructureCall = requiredRole__InfrastructureCallCasted;
             return;
         }
     }
 }