Exemplo n.º 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);
        }
Exemplo n.º 2
0
 private void Mors_Code_TextChanged(object sender, EventArgs e)
 {
     if (!ToText.Enabled)
     {
         NormalText.Text = MorseCode.MorseToNormalText(Mors_Code.Text);
     }
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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;
        }