示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#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);
 }
示例#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);
 }