Exemple #1
0
        private void FrmHome_Load(object sender, EventArgs e)
        {
            CBoxInput.Items.Add(TXT_FIELD);
            CBoxInput.Items.Add(TXT_FILE);
            CBoxInput.Text = TXT_FIELD;

            CBoxOutput.Items.Add(TXT_FIELD);
            CBoxOutput.Items.Add(TXT_FILE);
            CBoxOutput.Text = TXT_FIELD;

            CBoxMethod.Items.Add(METHOD_SUBSTITUTION);
            CBoxMethod.Text = METHOD_SUBSTITUTION;

            alphabet = new ResettableSet <char>();
            const int ASCII_MIN_NON_FORMAT_CHAR = 32;
            const int ASCII_MAX = 126;

            for (int i = ASCII_MIN_NON_FORMAT_CHAR; i <= ASCII_MAX; ++i)
            {
                alphabet.Add((char)i);
            }
        }
Exemple #2
0
 public SubstitutionCypher(string original, ResettableSet <char> alphabet)
 {
     this.original     = original;
     this.alphabetFrom = alphabet;
     alphabetTo        = new ResettableSet <char>(alphabetFrom);
 }
Exemple #3
0
 public ResettableSet(ResettableSet <T> set)
 {
     original = new LinkedList <T>(set.GetOriginal());
     working  = new LinkedList <T>(original);
 }