Esempio n. 1
0
        private void Configure_Click(object sender, EventArgs e)
        {
            ConfigureUser register = new ConfigureUser();

            register.ShowDialog();
            UserName.Text = Settings.Default.name;
        }
Esempio n. 2
0
        private void App_Load(object sender, EventArgs e)
        {
            var data = new List <Language>
            {
                new Language {
                    Name = "English", Value = "en-gb"
                },
                new Language {
                    Name = "Español", Value = "es-es"
                },
                new Language {
                    Name = "Français", Value = "fr-fr"
                },
                new Language {
                    Name = "Deutsche", Value = "de-ch"
                },
                new Language {
                    Name = "Italiano", Value = "it-it"
                },
                new Language {
                    Name = "عربى", Value = "ar-sa"
                },
                new Language {
                    Name = "Русский", Value = "ru-ru"
                },
                new Language {
                    Name = "Türk", Value = "tr-tr"
                },
                new Language {
                    Name = "Srpski", Value = "sr-sp"
                },
                new Language {
                    Name = "Slovenskí", Value = "sk-sk"
                }
            };

            this.Languages.DataSource    = data;
            this.Languages.DisplayMember = "Name";
            this.Languages.ValueMember   = "Value";
            this.Languages.DropDownStyle = ComboBoxStyle.DropDownList;
            this.Languages.SelectedIndex = 0;
            language = Languages.SelectedValue.ToString();
            Settings.Default.language = language;

            if (Settings.Default.name == "")
            {
                ConfigureUser register = new ConfigureUser();
                register.Cancel.Enabled = false;
                register.ShowDialog();
            }
            UserName.Text     = Settings.Default.name;
            UserName.ReadOnly = true;
        }