Ejemplo n.º 1
0
 /// <summary>
 /// Create a new EntryTranslation object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="entryId">Initial value of the EntryId property.</param>
 public static EntryTranslation CreateEntryTranslation(global::System.Guid id, global::System.Guid entryId)
 {
     EntryTranslation entryTranslation = new EntryTranslation();
     entryTranslation.Id = id;
     entryTranslation.EntryId = entryId;
     return entryTranslation;
 }
Ejemplo n.º 2
0
        bool UpdateEntry(Entry entry, bool checkForTheSameEng = true)
        {
            if (checkForTheSameEng && m_previewNewEntry.HasEntryWithEnglishWord(textBoxEng.Text))
            {
                MessageBox.Show("The word \"" + textBoxEng.Text + "\" already used. To modify it you must edit other entry", "Same English word", MessageBoxButton.OK, MessageBoxImage.Stop);
                return false;
            }

            entry.Eng = textBoxEng.Text;

            //remove all old translation from entry
            while (entry.EntryTranslations.Count > 0)
            {
                DictionaryEntities.Singleton.EntryTranslations.DeleteObject(entry.EntryTranslations.Last());
            }
            //and populate with new translations
            foreach (var translation in m_translations)
            {
                if (translation.Text == null || translation.Text.Length == 0)
                    continue;

                EntryTranslation entryTranslation = new EntryTranslation();
                entryTranslation.Entry = entry;
                entryTranslation.Rus = translation.Text;

                entry.EntryTranslations.Add(entryTranslation);
            }

            return true;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EntryTranslations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEntryTranslations(EntryTranslation entryTranslation)
 {
     base.AddObject("EntryTranslations", entryTranslation);
 }