/// <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.Successor == null)) { IAbstractUserAction successorCasted = item.As <IAbstractUserAction>(); if ((successorCasted != null)) { this._parent.Successor = successorCasted; return; } } if ((this._parent.Predecessor == null)) { IAbstractUserAction predecessorCasted = item.As <IAbstractUserAction>(); if ((predecessorCasted != null)) { this._parent.Predecessor = predecessorCasted; return; } } if ((this._parent.ScenarioBehaviour_AbstractUserAction == null)) { IScenarioBehaviour scenarioBehaviour_AbstractUserActionCasted = item.As <IScenarioBehaviour>(); if ((scenarioBehaviour_AbstractUserActionCasted != null)) { this._parent.ScenarioBehaviour_AbstractUserAction = scenarioBehaviour_AbstractUserActionCasted; 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.UsageModel_UsageScenario == null)) { IUsageModel usageModel_UsageScenarioCasted = item.As <IUsageModel>(); if ((usageModel_UsageScenarioCasted != null)) { this._parent.UsageModel_UsageScenario = usageModel_UsageScenarioCasted; return; } } if ((this._parent.ScenarioBehaviour_UsageScenario == null)) { IScenarioBehaviour scenarioBehaviour_UsageScenarioCasted = item.As <IScenarioBehaviour>(); if ((scenarioBehaviour_UsageScenarioCasted != null)) { this._parent.ScenarioBehaviour_UsageScenario = scenarioBehaviour_UsageScenarioCasted; return; } } if ((this._parent.Workload_UsageScenario == null)) { IWorkload workload_UsageScenarioCasted = item.As <IWorkload>(); if ((workload_UsageScenarioCasted != null)) { this._parent.Workload_UsageScenario = workload_UsageScenarioCasted; 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) { IScenarioBehaviour oldScenarioBehaviour_AbstractUserAction = ModelHelper.CastAs <IScenarioBehaviour>(oldParent); IScenarioBehaviour newScenarioBehaviour_AbstractUserAction = ModelHelper.CastAs <IScenarioBehaviour>(newParent); ValueChangedEventArgs e = new ValueChangedEventArgs(oldScenarioBehaviour_AbstractUserAction, newScenarioBehaviour_AbstractUserAction); this.OnScenarioBehaviour_AbstractUserActionChanging(e); this.OnPropertyChanging("ScenarioBehaviour_AbstractUserAction", e, _scenarioBehaviour_AbstractUserActionReference); }
/// <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.BranchedBehaviour_BranchTransition == null)) { IScenarioBehaviour branchedBehaviour_BranchTransitionCasted = item.As <IScenarioBehaviour>(); if ((branchedBehaviour_BranchTransitionCasted != null)) { this._parent.BranchedBehaviour_BranchTransition = branchedBehaviour_BranchTransitionCasted; 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) { IScenarioBehaviour oldScenarioBehaviour_AbstractUserAction = ModelHelper.CastAs <IScenarioBehaviour>(oldParent); IScenarioBehaviour newScenarioBehaviour_AbstractUserAction = ModelHelper.CastAs <IScenarioBehaviour>(newParent); if ((oldScenarioBehaviour_AbstractUserAction != null)) { oldScenarioBehaviour_AbstractUserAction.Actions_ScenarioBehaviour.Remove(this); } if ((newScenarioBehaviour_AbstractUserAction != null)) { newScenarioBehaviour_AbstractUserAction.Actions_ScenarioBehaviour.Add(this); } ValueChangedEventArgs e = new ValueChangedEventArgs(oldScenarioBehaviour_AbstractUserAction, newScenarioBehaviour_AbstractUserAction); this.OnScenarioBehaviour_AbstractUserActionChanged(e); this.OnPropertyChanged("ScenarioBehaviour_AbstractUserAction", e, _scenarioBehaviour_AbstractUserActionReference); base.OnParentChanged(newParent, oldParent); }
/// <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.LoopIteration_Loop == null)) { IPCMRandomVariable loopIteration_LoopCasted = item.As <IPCMRandomVariable>(); if ((loopIteration_LoopCasted != null)) { this._parent.LoopIteration_Loop = loopIteration_LoopCasted; return; } } if ((this._parent.BodyBehaviour_Loop == null)) { IScenarioBehaviour bodyBehaviour_LoopCasted = item.As <IScenarioBehaviour>(); if ((bodyBehaviour_LoopCasted != null)) { this._parent.BodyBehaviour_Loop = bodyBehaviour_LoopCasted; return; } } }