Exemplo n.º 1
0
 /// <summary>Guaranteed load of language factory and set at last saved selection</summary>
 /// <returns>The language factory</returns>
 private ILangFactory LanguageInit()
 {
     if (this.__languages == null)
     {
         this.__languages = this.container.GetObjSingleton <ILangFactory>();
         this.Load(
             this.Settings,
             dm => { this.__languages.SetCurrentLanguage(dm.CurrentLanguage); },
             err => { });
         this.__languages.LanguageChanged += this.languageChanged;
     }
     return(this.__languages);
 }
Exemplo n.º 2
0
        private LanguageSelector(Window parent, ILangFactory languageFactory)
        {
            this.parent          = parent;
            this.languageFactory = languageFactory;
            InitializeComponent();
            this.SizeToContent = SizeToContent.WidthAndHeight;

            // Connect to language event
            this.languageFactory.LanguageChanged += Languages_LanguageChanged;
            this.languageOnEntry = this.languageFactory.CurrentLanguageCode;

            // Call before rendering which will trigger initial resize events
            this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnSave);
            this.widthManager.PrepForChange();
        }
Exemplo n.º 3
0
 /// <summary>Replace default english supported language with current language factory</summary>
 ///<param name="currentFactory">The factory to set</param>
 public static void SetLanguageFactory(ILangFactory newFactory)
 {
     lock (lockObj) {
         factory = newFactory;
     }
 }
Exemplo n.º 4
0
        public static void ShowBox(Window parent, ILangFactory languageFactory)
        {
            LanguageSelector win = new LanguageSelector(parent, languageFactory);

            win.ShowDialog();
        }