Esempio n. 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;
        }
Esempio n. 2
0
        private void CommutersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SCommuters settings_Of_Commutators = new SCommuters();

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

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