Exemple #1
0
 /// <summary>
 /// Gets the relative URI fragment for the given child model element
 /// </summary>
 /// <returns>A fragment of the relative URI</returns>
 /// <param name="element">The element that should be looked for</param>
 protected override string GetRelativePathForNonIdentifiedChild(NMF.Models.IModelElement element)
 {
     if ((element == this.NewValue))
     {
         return(ModelHelper.CreatePath("NewValue"));
     }
     return(base.GetRelativePathForNonIdentifiedChild(element));
 }
        /// <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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            NMF.Models.Meta.IReferenceType oldDeclaringType = ModelHelper.CastAs <NMF.Models.Meta.IReferenceType>(oldParent);
            NMF.Models.Meta.IReferenceType newDeclaringType = ModelHelper.CastAs <NMF.Models.Meta.IReferenceType>(newParent);
            ValueChangedEventArgs          e = new ValueChangedEventArgs(oldDeclaringType, newDeclaringType);

            this.OnDeclaringTypeChanging(e);
            this.OnPropertyChanging("DeclaringType", e, _declaringTypeReference);
        }
Exemple #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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            INamespace            oldParentNamespace = ModelHelper.CastAs <INamespace>(oldParent);
            INamespace            newParentNamespace = ModelHelper.CastAs <INamespace>(newParent);
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldParentNamespace, newParentNamespace);

            this.OnParentNamespaceChanging(e);
            this.OnPropertyChanging("ParentNamespace", e, _parentNamespaceReference);
        }
Exemple #4
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            IRepository           oldRepository = ModelHelper.CastAs <IRepository>(oldParent);
            IRepository           newRepository = ModelHelper.CastAs <IRepository>(newParent);
            ValueChangedEventArgs e             = new ValueChangedEventArgs(oldRepository, newRepository);

            this.OnRepositoryChanging(e);
            this.OnPropertyChanging("Repository", e, _repositoryReference);
        }
Exemple #5
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            IOperation            oldOperation = ModelHelper.CastAs <IOperation>(oldParent);
            IOperation            newOperation = ModelHelper.CastAs <IOperation>(newParent);
            ValueChangedEventArgs e            = new ValueChangedEventArgs(oldOperation, newOperation);

            this.OnOperationChanging(e);
            this.OnPropertyChanging("Operation", e, _operationReference);
        }
        /// <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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            IResourceEnvironment  oldEnvironment = ModelHelper.CastAs <IResourceEnvironment>(oldParent);
            IResourceEnvironment  newEnvironment = ModelHelper.CastAs <IResourceEnvironment>(newParent);
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldEnvironment, newEnvironment);

            this.OnEnvironmentChanging(e);
            this.OnPropertyChanging("Environment", e, _environmentReference);
        }
Exemple #7
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            NMF.Models.Meta.IEnumeration oldEnumeration = ModelHelper.CastAs <NMF.Models.Meta.IEnumeration>(oldParent);
            NMF.Models.Meta.IEnumeration newEnumeration = ModelHelper.CastAs <NMF.Models.Meta.IEnumeration>(newParent);
            ValueChangedEventArgs        e = new ValueChangedEventArgs(oldEnumeration, newEnumeration);

            this.OnEnumerationChanging(e);
            this.OnPropertyChanging("Enumeration", e, _enumerationReference);
        }
Exemple #8
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            NMF.Models.IModelElement oldExtendedElement = ModelHelper.CastAs <NMF.Models.IModelElement>(oldParent);
            NMF.Models.IModelElement newExtendedElement = ModelHelper.CastAs <NMF.Models.IModelElement>(newParent);
            ValueChangedEventArgs    e = new ValueChangedEventArgs(oldExtendedElement, newExtendedElement);

            this.OnExtendedElementChanging(e);
            this.OnPropertyChanging("ExtendedElement", e, _extendedElementReference);
        }
Exemple #9
0
        /// <summary>
        /// Gets the relative URI fragment for the given child model element
        /// </summary>
        /// <returns>A fragment of the relative URI</returns>
        /// <param name="element">The element that should be looked for</param>
        protected override string GetRelativePathForNonIdentifiedChild(NMF.Models.IModelElement element)
        {
            int changesIndex = ModelHelper.IndexOfReference(this.Changes, element);

            if ((changesIndex != -1))
            {
                return(ModelHelper.CreatePath("changes", changesIndex));
            }
            return(base.GetRelativePathForNonIdentifiedChild(element));
        }
        /// <summary>
        /// Gets the relative URI fragment for the given child model element
        /// </summary>
        /// <returns>A fragment of the relative URI</returns>
        /// <param name="element">The element that should be looked for</param>
        protected override string GetRelativePathForNonIdentifiedChild(NMF.Models.IModelElement element)
        {
            if ((element == this.SourceChange))
            {
                return(ModelHelper.CreatePath("SourceChange"));
            }
            int nestedChangesIndex = ModelHelper.IndexOfReference(this.NestedChanges, element);

            if ((nestedChangesIndex != -1))
            {
                return(ModelHelper.CreatePath("nestedChanges", nestedChangesIndex));
            }
            return(base.GetRelativePathForNonIdentifiedChild(element));
        }
Exemple #11
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            NMF.Models.IModelElement oldExtendedElement = ModelHelper.CastAs <NMF.Models.IModelElement>(oldParent);
            NMF.Models.IModelElement newExtendedElement = ModelHelper.CastAs <NMF.Models.IModelElement>(newParent);
            if ((oldExtendedElement != null))
            {
                oldExtendedElement.Extensions.Remove(this);
            }
            if ((newExtendedElement != null))
            {
                newExtendedElement.Extensions.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldExtendedElement, newExtendedElement);

            this.OnExtendedElementChanged(e);
            this.OnPropertyChanged("ExtendedElement", e, _extendedElementReference);
            base.OnParentChanged(newParent, oldParent);
        }
Exemple #12
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            NMF.Models.Meta.IEnumeration oldEnumeration = ModelHelper.CastAs <NMF.Models.Meta.IEnumeration>(oldParent);
            NMF.Models.Meta.IEnumeration newEnumeration = ModelHelper.CastAs <NMF.Models.Meta.IEnumeration>(newParent);
            if ((oldEnumeration != null))
            {
                oldEnumeration.Literals.Remove(this);
            }
            if ((newEnumeration != null))
            {
                newEnumeration.Literals.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldEnumeration, newEnumeration);

            this.OnEnumerationChanged(e);
            this.OnPropertyChanged("Enumeration", e, _enumerationReference);
            base.OnParentChanged(newParent, oldParent);
        }
        /// <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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            NMF.Models.Meta.IReferenceType oldDeclaringType = ModelHelper.CastAs <NMF.Models.Meta.IReferenceType>(oldParent);
            NMF.Models.Meta.IReferenceType newDeclaringType = ModelHelper.CastAs <NMF.Models.Meta.IReferenceType>(newParent);
            if ((oldDeclaringType != null))
            {
                oldDeclaringType.References.Remove(this);
            }
            if ((newDeclaringType != null))
            {
                newDeclaringType.References.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldDeclaringType, newDeclaringType);

            this.OnDeclaringTypeChanged(e);
            this.OnPropertyChanged("DeclaringType", e, _declaringTypeReference);
            base.OnParentChanged(newParent, oldParent);
        }
Exemple #14
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            NMF.Models.Meta.INamespace oldNamespace = ModelHelper.CastAs <NMF.Models.Meta.INamespace>(oldParent);
            NMF.Models.Meta.INamespace newNamespace = ModelHelper.CastAs <NMF.Models.Meta.INamespace>(newParent);
            if ((oldNamespace != null))
            {
                oldNamespace.Types.Remove(this);
            }
            if ((newNamespace != null))
            {
                newNamespace.Types.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldNamespace, newNamespace);

            this.OnNamespaceChanged(e);
            this.OnPropertyChanged("Namespace", e, _namespaceReference);
            base.OnParentChanged(newParent, oldParent);
        }
Exemple #15
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            IOperation oldOperation = ModelHelper.CastAs <IOperation>(oldParent);
            IOperation newOperation = ModelHelper.CastAs <IOperation>(newParent);

            if ((oldOperation != null))
            {
                oldOperation.Parameters.Remove(this);
            }
            if ((newOperation != null))
            {
                newOperation.Parameters.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldOperation, newOperation);

            this.OnOperationChanged(e);
            this.OnPropertyChanged("Operation", e, _operationReference);
            base.OnParentChanged(newParent, oldParent);
        }
Exemple #16
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            IRepository oldRepository = ModelHelper.CastAs <IRepository>(oldParent);
            IRepository newRepository = ModelHelper.CastAs <IRepository>(newParent);

            if ((oldRepository != null))
            {
                oldRepository.Interfaces.Remove(this);
            }
            if ((newRepository != null))
            {
                newRepository.Interfaces.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldRepository, newRepository);

            this.OnRepositoryChanged(e);
            this.OnPropertyChanged("Repository", e, _repositoryReference);
            base.OnParentChanged(newParent, oldParent);
        }
Exemple #17
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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            IClass oldDeclaringType = ModelHelper.CastAs <IClass>(oldParent);
            IClass newDeclaringType = ModelHelper.CastAs <IClass>(newParent);

            if ((oldDeclaringType != null))
            {
                oldDeclaringType.AttributeConstraints.Remove(this);
            }
            if ((newDeclaringType != null))
            {
                newDeclaringType.AttributeConstraints.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldDeclaringType, newDeclaringType);

            this.OnDeclaringTypeChanged(e);
            this.OnPropertyChanged("DeclaringType", e, _declaringTypeReference);
            base.OnParentChanged(newParent, oldParent);
        }
        /// <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(NMF.Models.IModelElement newParent, NMF.Models.IModelElement oldParent)
        {
            IResourceEnvironment oldEnvironment = ModelHelper.CastAs <IResourceEnvironment>(oldParent);
            IResourceEnvironment newEnvironment = ModelHelper.CastAs <IResourceEnvironment>(newParent);

            if ((oldEnvironment != null))
            {
                oldEnvironment.Container.Remove(this);
            }
            if ((newEnvironment != null))
            {
                newEnvironment.Container.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldEnvironment, newEnvironment);

            this.OnEnvironmentChanged(e);
            this.OnPropertyChanged("Environment", e, _environmentReference);
            base.OnParentChanged(newParent, oldParent);
        }