示例#1
0
        /// <summary>
        /// Adds a preCondition to the modelized item
        /// </summary>
        /// <param name="preCondition"></param>
        /// <returns></returns>
        public override PreConditionTreeNode AddPreCondition(DataDictionary.Rules.PreCondition preCondition)
        {
            PreConditionTreeNode retVal = new PreConditionTreeNode(preCondition);

            Item.appendPreConditions(preCondition);
            Nodes.Add(retVal);
            SortSubNodes();

            Item.setVerified(false);

            return(retVal);
        }
        /// <summary>
        /// Create structure based on the subsystem structure
        /// </summary>
        /// <param name="SourceNode"></param>
        public override void AcceptDrop(BaseTreeNode SourceNode)
        {
            base.AcceptDrop(SourceNode);

            if (SourceNode is PreConditionTreeNode)
            {
                if (MessageBox.Show("Are you sure you want to move the corresponding function ?", "Move action", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    PreConditionTreeNode node = SourceNode as PreConditionTreeNode;
                    DataDictionary.Rules.PreCondition preCondition = node.Item;
                    node.Delete();
                    AddPreCondition(preCondition);
                }
            }
        }
        /// <summary>
        ///     Create structure based on the subsystem structure
        /// </summary>
        /// <param name="sourceNode"></param>
        public override void AcceptDrop(BaseTreeNode sourceNode)
        {
            base.AcceptDrop(sourceNode);

            PreConditionTreeNode preConditionTreeNode = sourceNode as PreConditionTreeNode;

            if (preConditionTreeNode != null)
            {
                if (
                    MessageBox.Show("Are you sure you want to move the corresponding function ?", "Move action",
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    preConditionTreeNode.Delete();
                    Item.appendPreConditions(preConditionTreeNode.Item);
                }
            }
        }
        /// <summary>
        ///     Handles a drop event
        /// </summary>
        /// <param name="sourceNode"></param>
        public override void AcceptDrop(BaseTreeNode sourceNode)
        {
            PreConditionTreeNode preConditionTreeNode = sourceNode as PreConditionTreeNode;

            if (preConditionTreeNode != null)
            {
                if (
                    MessageBox.Show("Are you sure you want to move the corresponding pre-condition ?",
                                    "Move pre-condition", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    PreCondition preCondition = preConditionTreeNode.Item;
                    preConditionTreeNode.Delete();
                    Item.appendPreConditions(preCondition);
                    Item.setVerified(false);
                }
            }
        }