Наследование: Generated.Translation, ITextualExplain, IEditable
Пример #1
0
        public override Translation createTranslation()
        {
            Translation retVal = new Tests.Translations.Translation();

            _defaultValueSetter.SetDefaultValue(retVal);

            return(retVal);
        }
Пример #2
0
 public override void visit(Translation obj, bool visitSubNodes)
 {
     Tests.Translations.Translation translation = (Tests.Translations.Translation)obj;
     if (!translation.getImplemented())
     {
         translation.AddInfo("Not implemented translation");
     }
     base.visit(obj, visitSubNodes);
 }
Пример #3
0
        /// <summary>
        /// Translates the current step according to the translation dictionary
        /// Removes all preconditions, actions and expectations
        /// </summary>
        /// <param name="translationDictionary"></param>
        public void Translate(Translations.TranslationDictionary translationDictionary)
        {
            if (getTranslationRequired())
            {
                SubSteps.Clear();

                Translations.Translation translation = translationDictionary.findTranslation(getDescription());
                if (translation != null)
                {
                    translation.UpdateStep(this);
                    setTranslated(true);
                }
            }
        }
Пример #4
0
            /// <summary>
            ///     Updates the step : comment has been moved
            /// </summary>
            /// <param name="obj"></param>
            /// <param name="visitSubNodes"></param>
            public override void visit(Translation obj, bool visitSubNodes)
            {
                Tests.Translations.Translation translation = (Tests.Translations.Translation)obj;

                if (!string.IsNullOrEmpty(translation.getObsoleteComment()))
                {
                    if (string.IsNullOrEmpty(translation.getComment()))
                    {
                        translation.setComment(translation.getObsoleteComment());
                    }
                    else
                    {
                        translation.setComment(translation.getComment() + "\n" + translation.getObsoleteComment());
                    }
                    translation.setObsoleteComment(null);
                }

                base.visit(obj, visitSubNodes);
            }
Пример #5
0
        public override Translation createTranslation()
        {
            Translation retVal = new Tests.Translations.Translation();

            _defaultValueSetter.SetDefaultValue(retVal);

            return retVal;
        }
        private void storeTranslationInCache(Translation translation)
        {
            foreach (SourceText sourceText in translation.SourceTexts)
            {
                string textDescription = StripText(sourceText.Name);

                Dictionary<string, Translation> tmp;
                if (!theCache.TryGetValue(textDescription, out tmp))
                {
                    tmp = new Dictionary<string, Translation>();
                    theCache[textDescription] = tmp;
                }

                if (sourceText.Comments.Count > 0)
                {
                    foreach (SourceTextComment comment in sourceText.Comments)
                    {
                        string commentValue = StripText(comment.Name);
                        tmp[commentValue] = translation;
                    }
                }
                else
                {
                    tmp[NO_SPECIFIC_COMMENT] = translation;
                }
            }
        }
 private void storeTranslationInCache(Translation translation)
 {
     foreach (SourceText sourceText in translation.SourceTexts)
     {
         string textDescription = StripText(sourceText.Name);
         theCache[textDescription] = translation;
     }
 }