예제 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dictionary"></param>
        public Window(DataDictionary.Tests.Translations.TranslationDictionary dictionary)
        {
            InitializeComponent();

            FormClosed += new FormClosedEventHandler(Window_FormClosed);
            Visible     = false;
            translationTreeView.Root = dictionary;
            Text = dictionary.Dictionary.Name + " test translation view";
            Refresh();
        }
예제 #2
0
        /// <summary>
        ///     Loads a translation dictionary and lock the file
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="dictionary"></param>
        /// <param name="lockFiles">Indicates that the files should be locked</param>
        /// <returns></returns>
        public static TranslationDictionary LoadTranslationDictionary(string filePath, Dictionary dictionary,
                                                                      bool lockFiles)
        {
            TranslationDictionary retVal = LoadFile <TranslationDictionary>(filePath, dictionary, lockFiles);

            if (retVal == null)
            {
                throw new Exception("Cannot read file " + filePath);
            }

            return(retVal);
        }
예제 #3
0
 /// <summary>
 ///     Translates the current step, according to the translation dictionary
 /// </summary>
 /// <param name="translationDictionary"></param>
 public void Translate(TranslationDictionary translationDictionary)
 {
     foreach (Step step in Steps)
     {
         step.Translate(translationDictionary);
     }
 }
예제 #4
0
 /// <summary>
 ///     Translates the frame according to the translation dictionary provided
 /// </summary>
 /// <param name="translationDictionary"></param>
 public void Translate(TranslationDictionary translationDictionary)
 {
     foreach (SubSequence subSequence in SubSequences)
     {
         subSequence.Translate(translationDictionary);
     }
 }
예제 #5
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(TranslationDictionary translationDictionary)
        {
            if (getTranslationRequired())
            {
                Util.DontNotify(() =>
                {
                    SubSteps.Clear();

                    Translation translation = null;
                    if (translationDictionary != null)
                    {
                        translation = translationDictionary.findTranslation(getDescription(), Comment);
                    }

                    if (translation != null)
                    {
                        translation.UpdateStep(this);
                        setTranslated(true);
                    }
                    else
                    {
                        AddWarning("Cannot find translation for this step");
                    }
                });
            }
        }