private void CustomizeMachine() { if (Enigma == null) { return; } bool[] Dirs = new bool[(int)udDiskCount.Value]; byte[] StartPoses = new byte[(byte)udDiskCount.Value]; for (byte i = 0; i < udDiskCount.Value; i++) { Dirs[i] = Convert.ToBoolean(gvDisks[2, i].Value); StartPoses[i] = Convert.ToByte(gvDisks[3, i].Value); } //tbKey.Text += Convert.ToString((byte)udStartPos.Value, 16); Enigma.Customize(Dirs, StartPoses); //tbSrcStr_TextChanged(null, null); }
private void BuildCustomize() { byte[] Seeds = new byte[(byte)udDiskCount.Value]; bool[] Dirs = new bool[(int)udDiskCount.Value]; byte[] StartPoses = new byte[(byte)udDiskCount.Value]; for (byte i = 0; i < udDiskCount.Value; i++) { Seeds[i] = Convert.ToByte(gvDisks[1, i].Value); Dirs[i] = Convert.ToBoolean(gvDisks[2, i].Value); StartPoses[i] = Convert.ToByte(gvDisks[3, i].Value); } Enigma = new EnigmaMachine(Seeds); Enigma.Customize(Dirs, StartPoses); }