コード例 #1
0
        public static string FullTextToMorse(String NText)
        {
            string MText = "";

            for (int i = 0; i < NText.Length; i++)
            {
                if (IsNumb(NText[i]))
                {
                    Diffrence    = 48;
                    DiffrenceAdd = 1;
                }
                else
                {
                    Diffrence    = 65;
                    DiffrenceAdd = 13;
                }

                if ((int)NText.ToUpper()[i] == 32)
                {
                    MText += "/";
                }
                else
                {
                    MText += MorseCode.ToMorseCode(MorseCode.ToCodeValue((int)NText.ToUpper()[i] - Diffrence + DiffrenceAdd));
                }
            }
            return(MText);
        }
コード例 #2
0
 private void Mors_Code_TextChanged(object sender, EventArgs e)
 {
     if (!ToText.Enabled)
     {
         NormalText.Text = MorseCode.MorseToNormalText(Mors_Code.Text);
     }
 }
コード例 #3
0
        private void NormalText_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.KeyCode == Keys.V) && e.Control)
            {
                Mors_Code.Text += MorseCode.FullTextToMorse(Clipboard.GetText());

                PastePressed = true;
            }
        }
コード例 #4
0
        private void NormalText_TextChanged(object sender, EventArgs e)
        {
            if (NormalText.Text.Length != 0 && !PastePressed && !ToMorse.Enabled)
            {
                Mors_Code.Text += MorseCode.NormalTextToMorse(NormalText.Text);
            }

            PastePressed = false;
        }