コード例 #1
0
 public void ChangeLanguage()
 {
     if (languages.Length == 0)
     {
         Debug.LogWarning("You have to set some languages in MenuManager before switching them."); return;
     }
     currentLanguage = (currentLanguage + 1) % languages.Length;
     MultiLanguageManager.SetLanguage(languages[currentLanguage]);
 }
コード例 #2
0
        static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure();
            ILog log = LogManager.GetLogger(typeof(Program));

            try
            {
                log.Info(LogFormat.Message("", "Application_start", LogStatus.Success, ""));

                MultiLanguageManager.SetDefaultLabelsDictionary <DSW.Localisation.Labels.Dictionary>();
                MultiLanguageManager.SetDefaultMessageDictionary <DSW.Localisation.Messages.Dictionary>();

                if (SingleInstanceApplication.IsExist())
                {
                    FormUtility.EnableTaskBar(false);
                    FormUtility.EnableTaskBar(true);

                    MessageUtility.DisplayErrorMsg(MultiLanguageManager.Messages.GetString(DSW.Localisation.Messages.Dictionary.Common.HT_COM_MS029),
                                                   MultiLanguageManager.Messages.GetString(DSW.Localisation.Messages.Dictionary.Common.HT_COM_CAP001));

                    log.Info(LogFormat.Message("", "Application_end", LogStatus.Failed, DSW.Localisation.Messages.Dictionary.Common.HT_COM_MS029));

                    Application.Exit();

                    return;
                }

                FormUtility.EnableTaskBar(false);

                AppDataService.SetSettingApiAddress(Setting.ApiAddress);

                var appModule       = new AppModule();
                var mvvmApplication = new MvvmApplication(appModule);

                mvvmApplication.Run <StocktakeNewView>();

                FormUtility.EnableTaskBar(true);

                log.Info(LogFormat.Message("", "Application_end", LogStatus.Success, ""));

                LogManager.Shutdown();
            }
            catch (Exception ex)
            {
                log.Info(LogFormat.Message("", "Application_end", LogStatus.Failed, ex.Message + Environment.NewLine + ex.StackTrace));

                LogManager.Shutdown();

                FormUtility.EnableTaskBar(false);
                FormUtility.EnableTaskBar(true);

                MessageUtility.DisplayErrorMsg(ex.Message,
                                               MultiLanguageManager.Messages.GetString(DSW.Localisation.Messages.Dictionary.Common.HT_COM_CAP001));

                Application.Exit();
            }
        }
コード例 #3
0
 void FindCurrentLanguageIndex()
 {
     for (int i = 0; i < languages.Length; i++)
     {
         if (languages[i] == MultiLanguageManager.GetCurrentLanguage())
         {
             currentLanguage = i;
             return;
         }
     }
 }
コード例 #4
0
        public LoadingView() : base()
        {
            InitializeComponent();
            this.Menu        = null;
            this.Activated  += new EventHandler(LoginView_Activated);
            this.Load       += new EventHandler(LoginView_OnLoad);
            this.Closing    += new CancelEventHandler(LoadingView_Closing);
            this.Closed     += new EventHandler(LoadingView_Closed);
            lblDotLeft.Text  = string.Empty;
            lblDotRight.Text = string.Empty;
            isAdd            = true;
            this.Deactivate += new EventHandler(LoadingView_Deactivate);

            MultiLanguageManager.SetDefaultLabelsDictionary <DSW.Localisation.Labels.Dictionary>();
        }
コード例 #5
0
    private void Start()
    {
        var languages = MultiLanguageManager.GetLanguages();

        foreach (var language in languages.LanguageList)
        {
            var languageObject = Instantiate(languageButton, languagesTransform);
            languageObject.SetActive(true);
            languageObject.GetComponentInChildren <Text>().text = language.LanguageString;
            languageObject.GetComponent <Button>().onClick.AddListener(() =>
            {
                MultiLanguageManager.CurrentLanguage = language.LanguageCode;
            });
        }
    }
コード例 #6
0
 protected override void OnEnable()
 {
     base.OnEnable();
     UpdateLanguage(MultiLanguageManager.GetCurrentLanguage());
 }