/// <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_SpecifiedQoSAnnation == null)) { ISignature signature_SpecifiedQoSAnnationCasted = item.As <ISignature>(); if ((signature_SpecifiedQoSAnnationCasted != null)) { this._parent.Signature_SpecifiedQoSAnnation = signature_SpecifiedQoSAnnationCasted; return; } } if ((this._parent.Role_SpecifiedQoSAnnotation == null)) { IRole role_SpecifiedQoSAnnotationCasted = item.As <IRole>(); if ((role_SpecifiedQoSAnnotationCasted != null)) { this._parent.Role_SpecifiedQoSAnnotation = role_SpecifiedQoSAnnotationCasted; return; } } if ((this._parent.QosAnnotations_SpecifiedQoSAnnotation == null)) { IQoSAnnotations qosAnnotations_SpecifiedQoSAnnotationCasted = item.As <IQoSAnnotations>(); if ((qosAnnotations_SpecifiedQoSAnnotationCasted != null)) { this._parent.QosAnnotations_SpecifiedQoSAnnotation = qosAnnotations_SpecifiedQoSAnnotationCasted; 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) { IQoSAnnotations oldQosAnnotations_SpecifiedQoSAnnotation = ModelHelper.CastAs <IQoSAnnotations>(oldParent); IQoSAnnotations newQosAnnotations_SpecifiedQoSAnnotation = ModelHelper.CastAs <IQoSAnnotations>(newParent); ValueChangedEventArgs e = new ValueChangedEventArgs(oldQosAnnotations_SpecifiedQoSAnnotation, newQosAnnotations_SpecifiedQoSAnnotation); this.OnQosAnnotations_SpecifiedQoSAnnotationChanging(e); this.OnPropertyChanging("QosAnnotations_SpecifiedQoSAnnotation", e, _qosAnnotations_SpecifiedQoSAnnotationReference); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IQoSAnnotations qosAnnotations_SystemCasted = item.As <IQoSAnnotations>(); if ((qosAnnotations_SystemCasted != null)) { this._parent.QosAnnotations_System.Add(qosAnnotations_SystemCasted); } }
/// <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) { IQoSAnnotations qoSAnnotationsItem = item.As <IQoSAnnotations>(); if (((qoSAnnotationsItem != null) && this._parent.QosAnnotations_System.Remove(qoSAnnotationsItem))) { return(true); } return(false); }
/// <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) { IQoSAnnotations oldQosAnnotations_SpecifiedQoSAnnotation = ModelHelper.CastAs <IQoSAnnotations>(oldParent); IQoSAnnotations newQosAnnotations_SpecifiedQoSAnnotation = ModelHelper.CastAs <IQoSAnnotations>(newParent); if ((oldQosAnnotations_SpecifiedQoSAnnotation != null)) { oldQosAnnotations_SpecifiedQoSAnnotation.SpecifiedQoSAnnotations_QoSAnnotations.Remove(this); } if ((newQosAnnotations_SpecifiedQoSAnnotation != null)) { newQosAnnotations_SpecifiedQoSAnnotation.SpecifiedQoSAnnotations_QoSAnnotations.Add(this); } ValueChangedEventArgs e = new ValueChangedEventArgs(oldQosAnnotations_SpecifiedQoSAnnotation, newQosAnnotations_SpecifiedQoSAnnotation); this.OnQosAnnotations_SpecifiedQoSAnnotationChanged(e); this.OnPropertyChanged("QosAnnotations_SpecifiedQoSAnnotation", e, _qosAnnotations_SpecifiedQoSAnnotationReference); 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.Signature_SpecifiedOutputParameterAbstraction == null)) { ISignature signature_SpecifiedOutputParameterAbstractionCasted = item.As <ISignature>(); if ((signature_SpecifiedOutputParameterAbstractionCasted != null)) { this._parent.Signature_SpecifiedOutputParameterAbstraction = signature_SpecifiedOutputParameterAbstractionCasted; return; } } if ((this._parent.Role_SpecifiedOutputParameterAbstraction == null)) { IRole role_SpecifiedOutputParameterAbstractionCasted = item.As <IRole>(); if ((role_SpecifiedOutputParameterAbstractionCasted != null)) { this._parent.Role_SpecifiedOutputParameterAbstraction = role_SpecifiedOutputParameterAbstractionCasted; return; } } IVariableUsage expectedExternalOutputs_SpecifiedOutputParameterAbstractionCasted = item.As <IVariableUsage>(); if ((expectedExternalOutputs_SpecifiedOutputParameterAbstractionCasted != null)) { this._parent.ExpectedExternalOutputs_SpecifiedOutputParameterAbstraction.Add(expectedExternalOutputs_SpecifiedOutputParameterAbstractionCasted); } if ((this._parent.QosAnnotations_SpecifiedOutputParameterAbstraction == null)) { IQoSAnnotations qosAnnotations_SpecifiedOutputParameterAbstractionCasted = item.As <IQoSAnnotations>(); if ((qosAnnotations_SpecifiedOutputParameterAbstractionCasted != null)) { this._parent.QosAnnotations_SpecifiedOutputParameterAbstraction = qosAnnotations_SpecifiedOutputParameterAbstractionCasted; return; } } }