/// <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) { IInternalAction oldInternalAction__InternalFailureOccurrenceDescription = ModelHelper.CastAs <IInternalAction>(oldParent); IInternalAction newInternalAction__InternalFailureOccurrenceDescription = ModelHelper.CastAs <IInternalAction>(newParent); ValueChangedEventArgs e = new ValueChangedEventArgs(oldInternalAction__InternalFailureOccurrenceDescription, newInternalAction__InternalFailureOccurrenceDescription); this.OnInternalAction__InternalFailureOccurrenceDescriptionChanging(e); this.OnPropertyChanging("InternalAction__InternalFailureOccurrenceDescription", e, _internalAction__InternalFailureOccurrenceDescriptionReference); }
/// <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) { IInternalAction oldInternalAction__InternalFailureOccurrenceDescription = ModelHelper.CastAs <IInternalAction>(oldParent); IInternalAction newInternalAction__InternalFailureOccurrenceDescription = ModelHelper.CastAs <IInternalAction>(newParent); if ((oldInternalAction__InternalFailureOccurrenceDescription != null)) { oldInternalAction__InternalFailureOccurrenceDescription.InternalFailureOccurrenceDescriptions__InternalAction.Remove(this); } if ((newInternalAction__InternalFailureOccurrenceDescription != null)) { newInternalAction__InternalFailureOccurrenceDescription.InternalFailureOccurrenceDescriptions__InternalAction.Add(this); } ValueChangedEventArgs e = new ValueChangedEventArgs(oldInternalAction__InternalFailureOccurrenceDescription, newInternalAction__InternalFailureOccurrenceDescription); this.OnInternalAction__InternalFailureOccurrenceDescriptionChanged(e); this.OnPropertyChanged("InternalAction__InternalFailureOccurrenceDescription", e, _internalAction__InternalFailureOccurrenceDescriptionReference); 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.InternalAction__InternalFailureOccurrenceDescription == null)) { IInternalAction internalAction__InternalFailureOccurrenceDescriptionCasted = item.As <IInternalAction>(); if ((internalAction__InternalFailureOccurrenceDescriptionCasted != null)) { this._parent.InternalAction__InternalFailureOccurrenceDescription = internalAction__InternalFailureOccurrenceDescriptionCasted; return; } } if ((this._parent.SoftwareInducedFailureType__InternalFailureOccurrenceDescription == null)) { ISoftwareInducedFailureType softwareInducedFailureType__InternalFailureOccurrenceDescriptionCasted = item.As <ISoftwareInducedFailureType>(); if ((softwareInducedFailureType__InternalFailureOccurrenceDescriptionCasted != null)) { this._parent.SoftwareInducedFailureType__InternalFailureOccurrenceDescription = softwareInducedFailureType__InternalFailureOccurrenceDescriptionCasted; return; } } }