Example #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.Capacity_PassiveResource == null))
     {
         IPCMRandomVariable capacity_PassiveResourceCasted = item.As <IPCMRandomVariable>();
         if ((capacity_PassiveResourceCasted != null))
         {
             this._parent.Capacity_PassiveResource = capacity_PassiveResourceCasted;
             return;
         }
     }
     if ((this._parent.BasicComponent_PassiveResource == null))
     {
         IBasicComponent basicComponent_PassiveResourceCasted = item.As <IBasicComponent>();
         if ((basicComponent_PassiveResourceCasted != null))
         {
             this._parent.BasicComponent_PassiveResource = basicComponent_PassiveResourceCasted;
             return;
         }
     }
     if ((this._parent.ResourceTimeoutFailureType__PassiveResource == null))
     {
         IResourceTimeoutFailureType resourceTimeoutFailureType__PassiveResourceCasted = item.As <IResourceTimeoutFailureType>();
         if ((resourceTimeoutFailureType__PassiveResourceCasted != null))
         {
             this._parent.ResourceTimeoutFailureType__PassiveResource = resourceTimeoutFailureType__PassiveResourceCasted;
             return;
         }
     }
 }
Example #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)
        {
            IBasicComponent       oldBasicComponent_ServiceEffectSpecification = ModelHelper.CastAs <IBasicComponent>(oldParent);
            IBasicComponent       newBasicComponent_ServiceEffectSpecification = ModelHelper.CastAs <IBasicComponent>(newParent);
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldBasicComponent_ServiceEffectSpecification, newBasicComponent_ServiceEffectSpecification);

            this.OnBasicComponent_ServiceEffectSpecificationChanging(e);
            this.OnPropertyChanging("BasicComponent_ServiceEffectSpecification", e, _basicComponent_ServiceEffectSpecificationReference);
        }
Example #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)
        {
            IBasicComponent       oldBasicComponent_PassiveResource = ModelHelper.CastAs <IBasicComponent>(oldParent);
            IBasicComponent       newBasicComponent_PassiveResource = ModelHelper.CastAs <IBasicComponent>(newParent);
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldBasicComponent_PassiveResource, newBasicComponent_PassiveResource);

            this.OnBasicComponent_PassiveResourceChanging(e);
            this.OnPropertyChanging("BasicComponent_PassiveResource", e, _basicComponent_PassiveResourceReference);
        }
Example #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)
        {
            IBasicComponent oldBasicComponent_ServiceEffectSpecification = ModelHelper.CastAs <IBasicComponent>(oldParent);
            IBasicComponent newBasicComponent_ServiceEffectSpecification = ModelHelper.CastAs <IBasicComponent>(newParent);

            if ((oldBasicComponent_ServiceEffectSpecification != null))
            {
                oldBasicComponent_ServiceEffectSpecification.ServiceEffectSpecifications__BasicComponent.Remove(this);
            }
            if ((newBasicComponent_ServiceEffectSpecification != null))
            {
                newBasicComponent_ServiceEffectSpecification.ServiceEffectSpecifications__BasicComponent.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldBasicComponent_ServiceEffectSpecification, newBasicComponent_ServiceEffectSpecification);

            this.OnBasicComponent_ServiceEffectSpecificationChanged(e);
            this.OnPropertyChanged("BasicComponent_ServiceEffectSpecification", e, _basicComponent_ServiceEffectSpecificationReference);
            base.OnParentChanged(newParent, oldParent);
        }
Example #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)
        {
            IBasicComponent oldBasicComponent_PassiveResource = ModelHelper.CastAs <IBasicComponent>(oldParent);
            IBasicComponent newBasicComponent_PassiveResource = ModelHelper.CastAs <IBasicComponent>(newParent);

            if ((oldBasicComponent_PassiveResource != null))
            {
                oldBasicComponent_PassiveResource.PassiveResource_BasicComponent.Remove(this);
            }
            if ((newBasicComponent_PassiveResource != null))
            {
                newBasicComponent_PassiveResource.PassiveResource_BasicComponent.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldBasicComponent_PassiveResource, newBasicComponent_PassiveResource);

            this.OnBasicComponent_PassiveResourceChanged(e);
            this.OnPropertyChanged("BasicComponent_PassiveResource", e, _basicComponent_PassiveResourceReference);
            base.OnParentChanged(newParent, oldParent);
        }
Example #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.DescribedService__SEFF == null))
     {
         ISignature describedService__SEFFCasted = item.As <ISignature>();
         if ((describedService__SEFFCasted != null))
         {
             this._parent.DescribedService__SEFF = describedService__SEFFCasted;
             return;
         }
     }
     if ((this._parent.BasicComponent_ServiceEffectSpecification == null))
     {
         IBasicComponent basicComponent_ServiceEffectSpecificationCasted = item.As <IBasicComponent>();
         if ((basicComponent_ServiceEffectSpecificationCasted != null))
         {
             this._parent.BasicComponent_ServiceEffectSpecification = basicComponent_ServiceEffectSpecificationCasted;
             return;
         }
     }
 }