Exemplo n.º 1
0
        public override SourceText createSourceText()
        {
            SourceText retVal = new Tests.Translations.SourceText();

            _defaultValueSetter.SetDefaultValue(retVal);

            return(retVal);
        }
Exemplo 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);
            }
        }
Exemplo n.º 3
0
        public override SourceText createSourceText()
        {
            SourceText retVal = new Tests.Translations.SourceText();

            _defaultValueSetter.SetDefaultValue(retVal);

            return retVal;
        }
        /// <summary>
        ///     Provides the existing translation corresponding to the source text provided
        /// </summary>
        /// <param name="sourceText"></param>
        /// <returns></returns>
        public Translation FindExistingTranslation(SourceText sourceText)
        {
            Translation existingTranslation = null;

            if (sourceText.Comments.Count > 0)
            {
                foreach (SourceTextComment comment in sourceText.Comments)
                {
                    existingTranslation = findTranslation(sourceText.Name, comment.Name);
                    if (existingTranslation != null)
                    {
                        break;
                    }
                }
            }
            else
            {
                existingTranslation = findTranslation(sourceText.Name, "");
            }

            return existingTranslation;
        }