Пример #1
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)
        {
            IInfrastructureInterface oldInfrastructureInterface__InfrastructureSignature = ModelHelper.CastAs <IInfrastructureInterface>(oldParent);
            IInfrastructureInterface newInfrastructureInterface__InfrastructureSignature = ModelHelper.CastAs <IInfrastructureInterface>(newParent);
            ValueChangedEventArgs    e = new ValueChangedEventArgs(oldInfrastructureInterface__InfrastructureSignature, newInfrastructureInterface__InfrastructureSignature);

            this.OnInfrastructureInterface__InfrastructureSignatureChanging(e);
            this.OnPropertyChanging("InfrastructureInterface__InfrastructureSignature", e, _infrastructureInterface__InfrastructureSignatureReference);
        }
Пример #2
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.ProvidedInterface__InfrastructureProvidedRole == null))
     {
         IInfrastructureInterface providedInterface__InfrastructureProvidedRoleCasted = item.As <IInfrastructureInterface>();
         if ((providedInterface__InfrastructureProvidedRoleCasted != null))
         {
             this._parent.ProvidedInterface__InfrastructureProvidedRole = providedInterface__InfrastructureProvidedRoleCasted;
             return;
         }
     }
 }
Пример #3
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IParameter parameters__InfrastructureSignatureCasted = item.As <IParameter>();

                if ((parameters__InfrastructureSignatureCasted != null))
                {
                    this._parent.Parameters__InfrastructureSignature.Add(parameters__InfrastructureSignatureCasted);
                }
                if ((this._parent.InfrastructureInterface__InfrastructureSignature == null))
                {
                    IInfrastructureInterface infrastructureInterface__InfrastructureSignatureCasted = item.As <IInfrastructureInterface>();
                    if ((infrastructureInterface__InfrastructureSignatureCasted != null))
                    {
                        this._parent.InfrastructureInterface__InfrastructureSignature = infrastructureInterface__InfrastructureSignatureCasted;
                        return;
                    }
                }
            }
Пример #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)
        {
            IInfrastructureInterface oldInfrastructureInterface__InfrastructureSignature = ModelHelper.CastAs <IInfrastructureInterface>(oldParent);
            IInfrastructureInterface newInfrastructureInterface__InfrastructureSignature = ModelHelper.CastAs <IInfrastructureInterface>(newParent);

            if ((oldInfrastructureInterface__InfrastructureSignature != null))
            {
                oldInfrastructureInterface__InfrastructureSignature.InfrastructureSignatures__InfrastructureInterface.Remove(this);
            }
            if ((newInfrastructureInterface__InfrastructureSignature != null))
            {
                newInfrastructureInterface__InfrastructureSignature.InfrastructureSignatures__InfrastructureInterface.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldInfrastructureInterface__InfrastructureSignature, newInfrastructureInterface__InfrastructureSignature);

            this.OnInfrastructureInterface__InfrastructureSignatureChanged(e);
            this.OnPropertyChanged("InfrastructureInterface__InfrastructureSignature", e, _infrastructureInterface__InfrastructureSignatureReference);
            base.OnParentChanged(newParent, oldParent);
        }