예제 #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;
        }