/// <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.Predecessor_AbstractAction == null)) { IAbstractAction predecessor_AbstractActionCasted = item.As <IAbstractAction>(); if ((predecessor_AbstractActionCasted != null)) { this._parent.Predecessor_AbstractAction = predecessor_AbstractActionCasted; return; } } if ((this._parent.Successor_AbstractAction == null)) { IAbstractAction successor_AbstractActionCasted = item.As <IAbstractAction>(); if ((successor_AbstractActionCasted != null)) { this._parent.Successor_AbstractAction = successor_AbstractActionCasted; return; } } if ((this._parent.ResourceDemandingBehaviour_AbstractAction == null)) { IResourceDemandingBehaviour resourceDemandingBehaviour_AbstractActionCasted = item.As <IResourceDemandingBehaviour>(); if ((resourceDemandingBehaviour_AbstractActionCasted != null)) { this._parent.ResourceDemandingBehaviour_AbstractAction = resourceDemandingBehaviour_AbstractActionCasted; return; } } }
/// <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) { IResourceDemandingBehaviour oldResourceDemandingBehaviour_AbstractAction = ModelHelper.CastAs <IResourceDemandingBehaviour>(oldParent); IResourceDemandingBehaviour newResourceDemandingBehaviour_AbstractAction = ModelHelper.CastAs <IResourceDemandingBehaviour>(newParent); ValueChangedEventArgs e = new ValueChangedEventArgs(oldResourceDemandingBehaviour_AbstractAction, newResourceDemandingBehaviour_AbstractAction); this.OnResourceDemandingBehaviour_AbstractActionChanging(e); this.OnPropertyChanging("ResourceDemandingBehaviour_AbstractAction", e, _resourceDemandingBehaviour_AbstractActionReference); }
/// <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.BranchBehaviour_BranchTransition == null)) { IResourceDemandingBehaviour branchBehaviour_BranchTransitionCasted = item.As <IResourceDemandingBehaviour>(); if ((branchBehaviour_BranchTransitionCasted != null)) { this._parent.BranchBehaviour_BranchTransition = branchBehaviour_BranchTransitionCasted; return; } } }
/// <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.BodyBehaviour_Loop == null)) { IResourceDemandingBehaviour bodyBehaviour_LoopCasted = item.As <IResourceDemandingBehaviour>(); if ((bodyBehaviour_LoopCasted != null)) { this._parent.BodyBehaviour_Loop = bodyBehaviour_LoopCasted; return; } } }
/// <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) { IResourceDemandingBehaviour oldResourceDemandingBehaviour_AbstractAction = ModelHelper.CastAs <IResourceDemandingBehaviour>(oldParent); IResourceDemandingBehaviour newResourceDemandingBehaviour_AbstractAction = ModelHelper.CastAs <IResourceDemandingBehaviour>(newParent); if ((oldResourceDemandingBehaviour_AbstractAction != null)) { oldResourceDemandingBehaviour_AbstractAction.Steps_Behaviour.Remove(this); } if ((newResourceDemandingBehaviour_AbstractAction != null)) { newResourceDemandingBehaviour_AbstractAction.Steps_Behaviour.Add(this); } ValueChangedEventArgs e = new ValueChangedEventArgs(oldResourceDemandingBehaviour_AbstractAction, newResourceDemandingBehaviour_AbstractAction); this.OnResourceDemandingBehaviour_AbstractActionChanged(e); this.OnPropertyChanged("ResourceDemandingBehaviour_AbstractAction", e, _resourceDemandingBehaviour_AbstractActionReference); base.OnParentChanged(newParent, oldParent); }