Exemplo n.º 1
0
        private void Symbol_Clicked(object sender, EventArgs e)
        {
            this.indicator.Focus();
            ToolStripButton Sender = (ToolStripButton)sender;
            int             code   = 0xFF00 + AppliedMath.HexToDec(Sender.Tag.ToString());

            if (this.SymbolSelected != null)
            {
                this.SymbolSelected(this, new EventArgs <char>((char)code));
            }
            this.Focus();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Преобразует указанный массив из формата RC51ASCII в бинарный формат
 /// (CRC не удаляется)
 /// </summary>
 public static byte[] ConvertFromRC51ASCII(byte[] buffer)
 {
     byte[] tmp = Utils.GetSubArray(buffer, 1, buffer.Length - 2);
     byte[] res = new byte[tmp.Length / 2];
     for (int i = 0; i < tmp.Length; i += 2)
     {
         byte[] code = { tmp[i], tmp[i + 1] };
         string h    = Encoding.ASCII.GetString(code);
         res[i / 2] = (byte)AppliedMath.HexToDec(h);
     }
     return(res);
 }