Changeset 7278


Ignore:
Timestamp:
Jan 17, 2018, 6:44:49 PM (4 years ago)
Author:
krauss
Message:

Enigma: Bugfix: convert initial rotor position to uppercase

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/Enigma/EnigmaSettings.cs

    r7277 r7278  
    4040        private ObservableCollection<string> rotorBStrings = new ObservableCollection<string>();
    4141        private ObservableCollection<string> reflectorStrings = new ObservableCollection<string>();
     42
    4243        private int model = 3;
    43         private int unknownSymbolHandling = 0; // 0=ignore, leave unmodified
    44         private int caseHandling = 0; // 0=preserve, 1, convert all to upper, 2= convert all to lower
     44        private int unknownSymbolHandling = 0; // 0 = ignore, 1 = leave unmodified
     45        private int caseHandling = 0; // 0 = preserve, 1 = convert all to upper, 2 = convert all to lower
    4546        private string _initialRotorPos = "AAA";
    4647        private string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
     
    6869        private void checkRotorChange(int rotor, int was, int becomes)
    6970        {
    70             switch (rotor)
    71             {
    72                 case 1:
    73                     if (rotor2 == becomes) { rotor2 = was; OnPropertyChanged("Rotor2"); }
    74                     if (rotor3 == becomes) { rotor3 = was; OnPropertyChanged("Rotor3"); }
    75                     break;
    76                 case 2:
    77                     if (rotor1 == becomes) { rotor1 = was; OnPropertyChanged("Rotor1"); }
    78                     if (rotor3 == becomes) { rotor3 = was; OnPropertyChanged("Rotor3"); }
    79                     break;
    80                 case 3:
    81                     if (rotor1 == becomes) { rotor1 = was; OnPropertyChanged("Rotor1"); }
    82                     if (rotor2 == becomes) { rotor2 = was; OnPropertyChanged("Rotor2"); }
    83                     break;
    84             }
     71            if (rotor1 == becomes) { rotor1 = was; OnPropertyChanged("Rotor1"); }
     72            if (rotor2 == becomes) { rotor2 = was; OnPropertyChanged("Rotor2"); }
     73            if (rotor3 == becomes) { rotor3 = was; OnPropertyChanged("Rotor3"); }
    8574        }
    8675
     
    119108        {
    120109            foreach (char c in this.alphabet)
    121             {
    122110                hideSettingsElement("PlugBoard" + c);
    123             }
     111
    124112            hideSettingsElement("PlugBoard");
    125113            hideSettingsElement("ResetPlugboard");
     
    129117        {
    130118            foreach (char c in this.alphabet)
    131             {
    132119                showSettingsElement("PlugBoard" + c);
    133             }
     120
    134121            showSettingsElement("PlugBoard");
    135122            showSettingsElement("ResetPlugboard");
     
    439426        public string InitialRotorPos
    440427        {
    441             get { return this._initialRotorPos; }
     428            get { return this._initialRotorPos.ToUpper(); }
    442429            set
    443430            {
    444431                if (value != _initialRotorPos)
    445432                {
    446                     this._initialRotorPos = value;
     433                    this._initialRotorPos = value.ToUpper();
    447434                    OnPropertyChanged("InitialRotorPos");   
    448435                }
Note: See TracChangeset for help on using the changeset viewer.