Simply3DScan
ConfigurationControl.Language.cs
Go to the documentation of this file.
1 using Configuration;
2 using System;
3 using SharedObjects;
4 
5 namespace Simple3DScan.UI
6 {
7  partial class ConfigurationControl
8  {
12  [LogException]
13  private void InitLanguageValues()
14  {
15  string[] allowedLanguages = { "English", "Deutsch" };
16 
17  int i = 0;
18 
19  foreach (string language in allowedLanguages)
20  {
21  this.comboBoxLanguage.Items.Add(language);
22 
23  if (this.configuration.Language.ToString() == language)
24  this.comboBoxLanguage.SelectedIndex = i;
25  i++;
26  }
27 
28  this.comboBoxLanguage.SelectedIndexChanged += this.comboBoxLanguage_SelectedIndexChanged;
29  }
30 
36  [Log]
37  [LogException]
38  private void comboBoxLanguage_SelectedIndexChanged(object sender, EventArgs e)
39  {
40  this.configuration.Language = EnumHelper.ParseEnum<Language>(this.comboBoxLanguage.Text);
41  }
42  }
43 }