Exemple #1
0
        /// <summary>
        /// Accepts drop of a tree node, in a drag & drop operation
        /// </summary>
        /// <param name="SourceNode"></param>
        public override void AcceptDrop(BaseTreeNode SourceNode)
        {
            base.AcceptDrop(SourceNode);

            if (SourceNode is StructureTreeNode)
            {
                StructureTreeNode structureTreeNode      = SourceNode as StructureTreeNode;
                DataDictionary.Types.Structure structure = structureTreeNode.Item;

                structureTreeNode.Delete();
                AddStructure(structure);
            }
            else if (SourceNode is SpecificationView.ParagraphTreeNode)
            {
                SpecificationView.ParagraphTreeNode    node     = SourceNode as SpecificationView.ParagraphTreeNode;
                DataDictionary.Specification.Paragraph paragaph = node.Item;

                DataDictionary.Types.Structure structure = (DataDictionary.Types.Structure)DataDictionary.Generated.acceptor.getFactory().createStructure();
                structure.Name = paragaph.Name;

                DataDictionary.ReqRef reqRef = (DataDictionary.ReqRef)DataDictionary.Generated.acceptor.getFactory().createReqRef();
                reqRef.Name = paragaph.FullId;
                structure.appendRequirements(reqRef);
                AddStructure(structure);
            }
        }
Exemple #2
0
        /// <summary>
        ///     Accepts drop of a tree node, in a drag & drop operation
        /// </summary>
        /// <param name="sourceNode"></param>
        public override void AcceptDrop(BaseTreeNode sourceNode)
        {
            base.AcceptDrop(sourceNode);

            if (sourceNode is StructureTreeNode)
            {
                StructureTreeNode structureTreeNode = sourceNode as StructureTreeNode;
                Structure         structure         = structureTreeNode.Item;

                structureTreeNode.Delete();
                Item.appendStructures(structure);
            }
            else if (sourceNode is ParagraphTreeNode)
            {
                ParagraphTreeNode node      = sourceNode as ParagraphTreeNode;
                Paragraph         paragraph = node.Item;

                Structure structure = Structure.CreateDefault(Item.Structures, false);
                Item.appendStructures(structure);
                structure.FindOrCreateReqRef(paragraph);
            }
        }