コード例 #1
0
        /// <summary>
        /// Handle language changed
        /// </summary>
        /// <param name="sender">Object sender</param>
        /// <param name="e">Event arguments</param>
        private void LanguageChanged(object sender, EventArgs e)
        {
            CultureManager cultureManager = (CultureManager)sender;

            this._translations = cultureManager.GetFunctionTranslation(this.TranslationKey);

            foreach (Container container in this._containers)
            {
                ApplyTranslation(container);
            }
        }
コード例 #2
0
 /// <summary>
 /// Create a new instance of GuiScreen and keep in mind the culture
 /// </summary>
 /// <param name="translationKey">Translation key</param>
 public GuiShot(string translationKey, CultureManager cultureManager, AudioManager audioManager, TimeSpan transitionTime)
     : base(transitionTime)
 {
     this._audioManager                        = audioManager;
     this.TranslationKey                       = translationKey;
     this._translations                        = cultureManager.GetFunctionTranslation(this.TranslationKey);
     cultureManager.LanguageChanged           += LanguageChanged;
     WindowContext.Window.MouseButtonReleased += MouseButtonReleased;
     WindowContext.Window.MouseMoved          += MouseMoved;
     WindowContext.Window.TextEntered         += TextEntered;
     WindowContext.Window.MouseButtonPressed  += MouseButtonPressed;
 }