コード例 #1
0
        /// <summary>
        /// config initialisation
        /// </summary>
        public static void Init()
        {
            Configs.SetLanguageDictionary();

            fileIniParser = new FileIniDataParser();
            fileIniParser.Parser.Configuration.CommentString = "#";

            if (!File.Exists(configFileUri))
            {
                createNewConfFile();
            }

            try {
                Data = fileIniParser.ReadFile(configFileUri);
                SetLanguageDictionary(Data.Global["lang"]);
            } catch (Exception e) {
                MessageBox.Show(Application.Current.Resources["sErrorReadConfigsFile"] as String + e.Message, Application.Current.Resources["sErrorConfigsFile"] as String, MessageBoxButton.OK, MessageBoxImage.Stop);
                Environment.Exit(0);
            }
        }
コード例 #2
0
 private void ComboBoxLang_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cbLang.SelectedItem != null)
     {
         if (((Lang)cbLang.SelectedItem).Code == "fr-FR")
         {
             Configs.SetLanguageDictionary("fr-FR");
             Configs.EditConfigData("lang", "fr-FR");
         }
         else
         {
             Configs.SetLanguageDictionary("en-US");
             Configs.EditConfigData("lang", "en-US");
         }
         dgProducts.UpdateLayout();
         dgAddresses.UpdateLayout();
         dgClients.UpdateLayout();
         dgOrder.UpdateLayout();
         dgOrderContent.UpdateLayout();
     }
 }