Ejemplo n.º 1
0
        /// <summary>
        ///     Accepts the drop event
        /// </summary>
        /// <param name="translationTreeNode"></param>
        /// <param name="sourceNode"></param>
        public static void AcceptDropForTranslation(TranslationTreeNode translationTreeNode, BaseTreeNode sourceNode)
        {
            if (sourceNode is SourceTextTreeNode)
            {
                SourceTextTreeNode text = sourceNode as SourceTextTreeNode;

                SourceText otherText = (SourceText)text.Item.Duplicate();
                translationTreeNode.Item.appendSourceTexts(otherText);
                text.Delete();
            }
            else if (sourceNode is StepTreeNode)
            {
                StepTreeNode step = sourceNode as StepTreeNode;

                if (string.IsNullOrEmpty(step.Item.getDescription()))
                {
                    MessageBox.Show(@"Step has no description and cannot be automatically translated",
                                    @"No description available", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    translationTreeNode.Item.appendSourceTexts(step.Item.CreateSourceText());
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles drop event
        /// </summary>
        /// <param name="SourceNode"></param>
        public override void AcceptDrop(BaseTreeNode SourceNode)
        {
            base.AcceptDrop(SourceNode);
            if (SourceNode is SourceTextTreeNode)
            {
                SourceTextTreeNode text = SourceNode as SourceTextTreeNode;

                DataDictionary.Tests.Translations.SourceText otherText = (DataDictionary.Tests.Translations.SourceText)DataDictionary.Generated.acceptor.getFactory().createSourceText();
                text.Item.copyTo(otherText);
                createSourceText(otherText);
                text.Delete();
            }
            else if (SourceNode is TestRunnerView.StepTreeNode)
            {
                TestRunnerView.StepTreeNode step = SourceNode as TestRunnerView.StepTreeNode;

                DataDictionary.Tests.Translations.SourceText sourceText = (DataDictionary.Tests.Translations.SourceText)DataDictionary.Generated.acceptor.getFactory().createSourceText();
                sourceText.Name = step.Item.getDescription();
                Item.appendSourceTexts(sourceText);
                createSourceText(sourceText);
            }
        }