コード例 #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)
        {
            MDEMGTT.Class.IClass  oldOwner = ModelHelper.CastAs <MDEMGTT.Class.IClass>(oldParent);
            MDEMGTT.Class.IClass  newOwner = ModelHelper.CastAs <MDEMGTT.Class.IClass>(newParent);
            ValueChangedEventArgs e        = new ValueChangedEventArgs(oldOwner, newOwner);

            this.OnOwnerChanging(e);
            this.OnPropertyChanging("Owner", e, _ownerReference);
        }
コード例 #2
0
ファイル: Class.cs プロジェクト: MeysamKarimi/MDEMGTT
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     MDEMGTT.Class.IClass superCasted = item.As <MDEMGTT.Class.IClass>();
     if ((superCasted != null))
     {
         this._parent.Super.Add(superCasted);
     }
     MDEMGTT.Class.IAttribute attrCasted = item.As <MDEMGTT.Class.IAttribute>();
     if ((attrCasted != null))
     {
         this._parent.Attr.Add(attrCasted);
     }
 }
コード例 #3
0
ファイル: Class.cs プロジェクト: MeysamKarimi/MDEMGTT
 /// <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)
 {
     MDEMGTT.Class.IClass classItem = item.As <MDEMGTT.Class.IClass>();
     if (((classItem != null) &&
          this._parent.Super.Remove(classItem)))
     {
         return(true);
     }
     MDEMGTT.Class.IAttribute attributeItem = item.As <MDEMGTT.Class.IAttribute>();
     if (((attributeItem != null) &&
          this._parent.Attr.Remove(attributeItem)))
     {
         return(true);
     }
     return(false);
 }
コード例 #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)
        {
            MDEMGTT.Class.IClass oldOwner = ModelHelper.CastAs <MDEMGTT.Class.IClass>(oldParent);
            MDEMGTT.Class.IClass newOwner = ModelHelper.CastAs <MDEMGTT.Class.IClass>(newParent);
            if ((oldOwner != null))
            {
                oldOwner.Attr.Remove(this);
            }
            if ((newOwner != null))
            {
                newOwner.Attr.Add(this);
            }
            ValueChangedEventArgs e = new ValueChangedEventArgs(oldOwner, newOwner);

            this.OnOwnerChanged(e);
            this.OnPropertyChanged("Owner", e, _ownerReference);
            base.OnParentChanged(newParent, oldParent);
        }
コード例 #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.Owner == null))
     {
         MDEMGTT.Class.IClass ownerCasted = item.As <MDEMGTT.Class.IClass>();
         if ((ownerCasted != null))
         {
             this._parent.Owner = ownerCasted;
             return;
         }
     }
     if ((this._parent.Type == null))
     {
         IClassifier typeCasted = item.As <IClassifier>();
         if ((typeCasted != null))
         {
             this._parent.Type = typeCasted;
             return;
         }
     }
 }
コード例 #6
0
ファイル: Class.cs プロジェクト: MeysamKarimi/MDEMGTT
 /// <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 IsAbstractProxy(MDEMGTT.Class.IClass modelElement) :
     base(modelElement, "isAbstract")
 {
 }