/// <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 EnumerationTreeNode) { EnumerationTreeNode enumerationTreeNode = SourceNode as EnumerationTreeNode; DataDictionary.Types.Enum enumeration = enumerationTreeNode.Item; enumerationTreeNode.Delete(); AddEnum(enumeration); } else if (SourceNode is SpecificationView.ParagraphTreeNode) { SpecificationView.ParagraphTreeNode node = SourceNode as SpecificationView.ParagraphTreeNode; DataDictionary.Specification.Paragraph paragaph = node.Item; DataDictionary.Types.Enum enumeration = (DataDictionary.Types.Enum)DataDictionary.Generated.acceptor.getFactory().createEnum(); enumeration.Name = paragaph.Name; DataDictionary.ReqRef reqRef = (DataDictionary.ReqRef)DataDictionary.Generated.acceptor.getFactory().createReqRef(); reqRef.Name = paragaph.FullId; enumeration.appendRequirements(reqRef); AddEnum(enumeration); } }
/// <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 EnumerationTreeNode) { EnumerationTreeNode enumerationTreeNode = sourceNode as EnumerationTreeNode; Enum enumeration = enumerationTreeNode.Item; enumerationTreeNode.Delete(); Item.appendEnumerations(enumeration); } else if (sourceNode is ParagraphTreeNode) { ParagraphTreeNode node = sourceNode as ParagraphTreeNode; Paragraph paragraph = node.Item; Enum enumeration = Enum.CreateDefault(Item.Enumerations); Item.appendEnumerations(enumeration); enumeration.FindOrCreateReqRef(paragraph); } }