コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void onDeleteBlock(DesignerItem sender)
        {
            if (this.EditedObject != null && sender.Tag != null)
            {
                TransformationTreeItem entity = (TransformationTreeItem)sender.Tag;

                if (entity.parent != null)
                {
                    if (entity.childrenListChangeHandler.Items.Count > 0)
                    {
                        TransformationTreeItem entityChild = entity.childrenListChangeHandler.Items[0];
                        entity.ForgetChild(entityChild);
                        entityChild.parent = null;
                        this.EditedObject.AddItem(entityChild);
                    }

                    entity.parent.RemoveChild(entity);
                }
                else
                {
                    this.EditedObject.DeleteItem(entity);
                }
                this.IsModify = true;
            }
        }
コード例 #2
0
        private void onMoveLinkSource(DesignerItem oldParent, DesignerItem child, DesignerItem newParent)
        {
            if (oldParent.Tag == null || child.Tag == null || newParent.Tag == null)
            {
                return;
            }
            TransformationTreeItem oldParentTag = (TransformationTreeItem)oldParent.Tag;
            TransformationTreeItem newParentTag = (TransformationTreeItem)newParent.Tag;
            TransformationTreeItem childTag     = (TransformationTreeItem)child.Tag;

            oldParentTag.ForgetChild(childTag);
            childTag.parent = null;
            newParentTag.AddChild(childTag);
            this.IsModify = true;
        }
コード例 #3
0
        private void onMoveLinkTarget(DesignerItem parent, DesignerItem oldChild, DesignerItem newChild)
        {
            if (parent.Tag == null || oldChild.Tag == null || newChild.Tag == null)
            {
                return;
            }
            TransformationTreeItem parentTag   = (TransformationTreeItem)parent.Tag;
            TransformationTreeItem oldChildTag = (TransformationTreeItem)oldChild.Tag;
            TransformationTreeItem newChildTag = (TransformationTreeItem)newChild.Tag;

            parentTag.ForgetChild(oldChildTag);
            oldChildTag.parent = null;
            this.EditedObject.AddItem(oldChildTag);
            parentTag.AddChild(newChildTag);
            this.IsModify = true;
        }
コード例 #4
0
        /// <summary>
        /// Cette methode est appelée lorsau'on a supprimé un lien entre deaux blocks
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="child"></param>
        protected void onDeleteLink(DesignerItem parent, DesignerItem child)
        {
            if (parent.Tag == null || child.Tag == null)
            {
                return;
            }
            TransformationTreeItem parentTag = parent.Tag is TransformationTreeItem ? (TransformationTreeItem)parent.Tag : null;
            TransformationTreeItem childTag  = (TransformationTreeItem)child.Tag;

            if (parentTag != null)
            {
                parentTag.ForgetChild(childTag);
                childTag.parent = null;
                this.EditedObject.AddItem(childTag);
                this.IsModify = true;
            }
        }