Exemple #1
0
        private void Main_Load(object sender, EventArgs e)
        {
            Rotor1Value.Items.AddRange(Crypt.EnglishAlphabet);
            Rotor2Value.Items.AddRange(Crypt.EnglishAlphabet);
            Rotor3Value.Items.AddRange(Crypt.EnglishAlphabet);

            Rotor1Value.SelectedIndex = 0;
            Rotor2Value.SelectedIndex = 0;
            Rotor3Value.SelectedIndex = 0;

            Original_text.Text = DataStorage.Properties.AppResourses.DefaultValue;



            //DataStorage.Settings.Default.Reflectors.Clear();
            //DataStorage.Settings.Default.Reflectors = null;

            if (DataStorage.Settings.Default.Reflectors == null)
            {
                SReflectors.SetDefaultValues();
            }
            reflector.Items.AddRange(FSettings.ConvertListToShow(DataStorage.Settings.Default.Reflectors.Keys.ToList()).ToArray());
            reflector.SelectedIndex = 0;


            //DataStorage.Settings.Default.Commuters.Clear();
            ///DataStorage.Settings.Default.Commuters = null;

            if (DataStorage.Settings.Default.Commuters == null)
            {
                SCommuters.SetDefaultValues();
            }
            commuter.Items.AddRange(FSettings.ConvertListToShow(DataStorage.Settings.Default.Commuters.Keys.ToList()).ToArray());
            commuter.SelectedIndex = 0;


            //DataStorage.Settings.Default.Rotors.Clear();
            //DataStorage.Settings.Default.Rotors = null;

            if (DataStorage.Settings.Default.Rotors == null)
            {
                SRotors.SetDefaultValues();
            }
            rotor1.Items.AddRange(FSettings.ConvertListToShow(DataStorage.Settings.Default.Rotors.Keys.ToList()).ToArray());
            rotor2.Items.AddRange(FSettings.ConvertListToShow(DataStorage.Settings.Default.Rotors.Keys.ToList()).ToArray());
            rotor3.Items.AddRange(FSettings.ConvertListToShow(DataStorage.Settings.Default.Rotors.Keys.ToList()).ToArray());
            rotor1.SelectedIndex = 0;
            rotor2.SelectedIndex = 0;
            rotor3.SelectedIndex = 0;
        }
Exemple #2
0
        private void ReflectorsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SReflectors settings_Of_Reflectors = new SReflectors();

            settings_Of_Reflectors.ShowDialog();
            object temp = reflector.SelectedItem;

            reflector.Items.Clear();
            reflector.Items.AddRange(FSettings.ConvertListToShow(DataStorage.Settings.Default.Reflectors.Keys.ToList()).ToArray());
            if (reflector.Items.Contains(temp))
            {
                reflector.SelectedItem = temp;
            }
            else
            {
                reflector.SelectedIndex = 0;
            }
        }