Ejemplo n.º 1
0
        private void NewCultureButton_Click(object sender, EventArgs e)
        {
            CultureViewer cultureViewer = new CultureViewer(new Culture(), true);

            if (cultureViewer.ShowDialog() == DialogResult.OK)
            {
                DisplayedCultures[cultureViewer.DisplayedCulture.id] = cultureViewer.DisplayedCulture.Copy();
                if (!culturesListBox.Items.Contains(cultureViewer.DisplayedCulture.id))
                {
                    culturesListBox.Items.Add(cultureViewer.DisplayedCulture.id);
                }
            }
        }
Ejemplo n.º 2
0
        private void CulturesListBox_DoubleClick(object sender, EventArgs e)
        {
            if (culturesListBox.SelectedItem == null)
            {
                return;
            }

            string        id = culturesListBox.SelectedItem as string;
            CultureViewer cv = new CultureViewer(DisplayedCultures[id].Copy(), Editing);

            if (cv.ShowDialog() == DialogResult.OK)
            {
                if (cv.DisplayedCulture.id != id)
                {
                    DisplayedCultures.Remove(id);
                    DisplayedCultures[cv.DisplayedCulture.id] = cv.DisplayedCulture.Copy();
                }
                else
                {
                    DisplayedCultures[id] = cv.DisplayedCulture.Copy();
                }
            }
        }