Exemple #1
0
        private void button_modify_Click(object sender, RoutedEventArgs e)
        {
            string        LanguageName     = (listview_locallabel.SelectedItem as label).lang;
            string        ElementNameValue = (listview_locallabel.SelectedItem as label).Text[0];
            List <string> ExistList        = new List <string>();

            foreach (label Item in LanguageList)
            {
                ExistList.Add(Item.lang);
            }

            LocalizationWizard LWizard = new LocalizationWizard("Name", LanguageName, ElementNameValue, ExistList: ExistList);

            if (LWizard.ShowDialog() == true)
            {
                if (LanguageList.Contains((listview_locallabel.SelectedItem as label)))
                {
                    LanguageList.Remove((listview_locallabel.SelectedItem as label));
                }

                var label = new label();
                label.lang = LWizard.LangComboBox.Text;
                label.Text = LWizard.ElementNameTextBox.Text.Trim().Split('\n');
                LanguageList.Add(label);
            }

            if (listview_locallabel.Items.Count == 0 || listview_locallabel.SelectedItem == null)
            {
                LangListBtnEnable(false);
            }
        }
Exemple #2
0
        private void button_add_Click(object sender, RoutedEventArgs e)
        {
            List <string> ExistList = new List <string>();

            foreach (label Item in LanguageList)
            {
                ExistList.Add(Item.lang);
            }

            LocalizationWizard LWizard = new LocalizationWizard("Name", ExistList: ExistList);

            if (LWizard.ShowDialog() == true)
            {
                var label = new label();
                label.lang = LWizard.LangComboBox.Text;
                label.Text = LWizard.ElementNameTextBox.Text.Trim().Split('\n');
                LanguageList.Add(label);
            }
        }