Exemplo n.º 1
0
 private void ApplyInput()
 {
     try
     {
         bool            useLong = cbUseLong.Checked;
         TenHexConverter th      = useLong ? TenHexConverter.ParseLong(tbInput.Text, _inputType) : TenHexConverter.Parse(tbInput.Text, _inputType);
         lblErr.Text = String.Empty;
         lblBin.Text = th.BinValue;
         lblOct.Text = th.OctValue;
         lblDec.Text = th.DecimalValue;
         lblHex.Text = th.HexValue;
     }
     catch (Exception ex)
     {
         lblBin.Text = lblOct.Text = lblDec.Text = lblHex.Text = String.Empty;
         lblErr.Text = ex.Message;
     }
 }
Exemplo n.º 2
0
    private void ApplyInput()
    {
        InputType it = GetInputType();

        lblInput.Text = String.Format("Enter {0} Value:", it);
        string input   = tbInput.Text;
        bool   useLong = cbLong.Checked;

        try
        {
            TenHexConverter tc = useLong ? TenHexConverter.ParseLong(input, it) : TenHexConverter.Parse(input, it);
            errMsg.Text = String.Empty;
            lblHex.Text = tc.HexValue;
            lblDec.Text = tc.DecimalValue;
            lblOct.Text = tc.OctValue;
            lblBin.Text = tc.BinValue;
        }
        catch (Exception ex)
        {
            lblHex.Text = lblDec.Text = lblOct.Text = lblBin.Text = String.Empty;
            errMsg.Text = ex.Message;
        }
    }