Ejemplo n.º 1
0
        /// <summary>
        /// Removes language from viewModel and model.
        /// </summary>
        /// <param name="languageViewModel"></param>
        public void RemoveLanguage(LingvaViewModel languageViewModel)
        {
            Lingva lang = languageViewModel.CurrentLanguage;

            L.Logger.Debug(string.Format("Removing {0} language from {1}.",
                                         lang.Language, lang.Folder));
            model.RemoveOldLanguage(lang);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds new language to viewmodel and model.
        /// </summary>
        /// <param name="languageViewModel"></param>
        public void AddNewLanguage(LingvaViewModel languageViewModel)
        {
            L.Logger.Debug("Adding new language.");
            // Use copy constructor.
            Lingva lang = new Lingva(languageViewModel.CurrentLanguage);

            model.AddNewLanguage(lang);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Changes state of viewModel according to selected language.
        /// </summary>
        /// <param name="item"></param>
        public void SelectLanguage(object item)
        {
            L.Logger.Debug("Language is selected.");
            LingvaViewModel lang = (LingvaViewModel)item;

            // Let the model know that selected language changed
            model.SelectLanguage(lang.CurrentLanguage);
        }
Ejemplo n.º 4
0
        // Equals override
        public override bool Equals(object obj)
        {
            LingvaViewModel item = obj as LingvaViewModel;

            if (item == null)
            {
                return(false);
            }
            return(this.currentLanguage.Equals(item.currentLanguage));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Removes language from viewModel and model.
 /// </summary>
 /// <param name="languageViewModel"></param>
 public void RemoveLanguage(LingvaViewModel languageViewModel)
 {
     Lingva lang = languageViewModel.CurrentLanguage;
     L.Logger.Debug(string.Format("Removing {0} language from {1}.",
         lang.Language, lang.Folder));
     model.RemoveOldLanguage(lang);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Adds new language to viewmodel and model.
 /// </summary>
 /// <param name="languageViewModel"></param>
 public void AddNewLanguage(LingvaViewModel languageViewModel)
 {
     L.Logger.Debug("Adding new language.");
     // Use copy constructor.
     Lingva lang = new Lingva(languageViewModel.CurrentLanguage);
     model.AddNewLanguage(lang);
 }