コード例 #1
0
ファイル: Form1.cs プロジェクト: schenkofil/ADFGVX_cypher
        private void button6_Click(object sender, EventArgs e)
        {
            textBox2.Visible = false;
            label2.Visible   = false;
            button6.Visible  = false;

            for (int i = 0; i < ADFGXTextBoxes.Count() && i < FillADFGX.Length; i++)
            {
                ADFGXTextBoxes[i].Text = FillADFGX[i].ToString();
            }

            MatriceADFGX = Cell.CreateMatrice(FillADFGX);

            if (FormattedMessage.Length > 0)
            {
                string dumb = String.Empty;
                for (int i = 0; i < FormattedMessage.Length; i++)
                {
                    var cell = MatriceADFGX.FirstOrDefault(x => x.letter == FormattedMessage[i]);
                    dumb += cell.RowLetter.ToString() + cell.ColumnLetter.ToString();
                }
                FractionatedMessage = dumb;
            }
            richTextBox8.Text = SpacingByTwo(FractionatedMessage);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: schenkofil/ADFGVX_cypher
        private void button4_Click(object sender, EventArgs e)
        {
            textBox2.Visible = false;
            label2.Visible   = false;
            button6.Visible  = false;

            foreach (var p in ADFGXTextBoxes)
            {
                p.Enabled = false;
            }
            string mixed = ADFGXLang == "cs" ? MixedAlphabetADFGXcs() : MixedAlphabetADFGXen();

            MatriceADFGX = Cell.CreateMatrice(mixed);
            for (int i = 0; i < mixed.Length && i < ADFGXTextBoxes.Count(); i++)
            {
                ADFGXTextBoxes[i].Text = mixed[i].ToString();
            }
            if (FormattedMessage.Length > 0)
            {
                string dumb = String.Empty;
                for (int i = 0; i < FormattedMessage.Length; i++)
                {
                    var cell = MatriceADFGX.FirstOrDefault(x => x.letter == FormattedMessage[i]);
                    dumb += cell.RowLetter.ToString() + cell.ColumnLetter.ToString();
                }
                FractionatedMessage = dumb;
            }
            richTextBox8.Text = SpacingByTwo(FractionatedMessage);
        }