Ejemplo n.º 1
0
            /// <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)
            {
                IEClass eClassItem = item.As <IEClass>();

                if (((eClassItem != null) &&
                     this._parent.ESuperTypes.Remove(eClassItem)))
                {
                    return(true);
                }
                IEOperation eOperationItem = item.As <IEOperation>();

                if (((eOperationItem != null) &&
                     this._parent.EOperations.Remove(eOperationItem)))
                {
                    return(true);
                }
                IEStructuralFeature eStructuralFeatureItem = item.As <IEStructuralFeature>();

                if (((eStructuralFeatureItem != null) &&
                     this._parent.EStructuralFeatures.Remove(eStructuralFeatureItem)))
                {
                    return(true);
                }
                return(false);
            }
Ejemplo n.º 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)
            {
                IEClass eSuperTypesCasted = item.As <IEClass>();

                if ((eSuperTypesCasted != null))
                {
                    this._parent.ESuperTypes.Add(eSuperTypesCasted);
                }
                IEOperation eOperationsCasted = item.As <IEOperation>();

                if ((eOperationsCasted != null))
                {
                    this._parent.EOperations.Add(eOperationsCasted);
                }
                IEStructuralFeature eStructuralFeaturesCasted = item.As <IEStructuralFeature>();

                if ((eStructuralFeaturesCasted != null))
                {
                    this._parent.EStructuralFeatures.Add(eStructuralFeaturesCasted);
                }
                IEGenericType eGenericSuperTypesCasted = item.As <IEGenericType>();

                if ((eGenericSuperTypesCasted != null))
                {
                    this._parent.EGenericSuperTypes.Add(eGenericSuperTypesCasted);
                }
            }
Ejemplo n.º 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)
        {
            IEClass oldEContainingClass = ModelHelper.CastAs <IEClass>(oldParent);
            IEClass newEContainingClass = ModelHelper.CastAs <IEClass>(newParent);
            ValueChangedEventArgs e     = new ValueChangedEventArgs(oldEContainingClass, newEContainingClass);

            this.OnEContainingClassChanging(e);
            this.OnPropertyChanging("EContainingClass");
        }
Ejemplo n.º 4
0
 public override void Transform(IEClass input, Class output, ITransformationContext context)
 {
     base.Transform(input, output, context);
     if (output.BaseTypes.Count == 1)
     {
         output.BaseTypes.Insert(0, new TypeReference {
             BaseName = "DBObject"
         });
     }
 }
Ejemplo n.º 5
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.EContainingClass == null))
     {
         IEClass eContainingClassCasted = item.As <IEClass>();
         if ((eContainingClassCasted != null))
         {
             this._parent.EContainingClass = eContainingClassCasted;
             return;
         }
     }
 }
Ejemplo n.º 6
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)
        {
            IEClass oldEContainingClass = ModelHelper.CastAs <IEClass>(oldParent);
            IEClass newEContainingClass = ModelHelper.CastAs <IEClass>(newParent);

            if ((oldEContainingClass != null))
            {
                oldEContainingClass.EStructuralFeatures.Remove(this);
            }
            if ((newEContainingClass != null))
            {
                newEContainingClass.EStructuralFeatures.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldEContainingClass, newEContainingClass);

            this.OnEContainingClassChanged(e);
            this.OnPropertyChanged("EContainingClass", e);
        }
Ejemplo n.º 7
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.EContainingClass == null))
                {
                    IEClass eContainingClassCasted = item.As <IEClass>();
                    if ((eContainingClassCasted != null))
                    {
                        this._parent.EContainingClass = eContainingClassCasted;
                        return;
                    }
                }
                IETypeParameter eTypeParametersCasted = item.As <IETypeParameter>();

                if ((eTypeParametersCasted != null))
                {
                    this._parent.ETypeParameters.Add(eTypeParametersCasted);
                }
                IEParameter eParametersCasted = item.As <IEParameter>();

                if ((eParametersCasted != null))
                {
                    this._parent.EParameters.Add(eParametersCasted);
                }
                IEClassifier eExceptionsCasted = item.As <IEClassifier>();

                if ((eExceptionsCasted != null))
                {
                    this._parent.EExceptions.Add(eExceptionsCasted);
                }
                IEGenericType eGenericExceptionsCasted = item.As <IEGenericType>();

                if ((eGenericExceptionsCasted != null))
                {
                    this._parent.EGenericExceptions.Add(eGenericExceptionsCasted);
                }
            }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a new observable property access proxy
 /// </summary>
 /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
 public InterfaceProxy(IEClass modelElement) :
     base(modelElement, "interface")
 {
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates a new observable property access proxy
 /// </summary>
 /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
 public AbstractProxy(IEClass modelElement) :
     base(modelElement, "abstract")
 {
 }