public bool Equals(BinaryNumber number)
        {
            Char[] numberCode = number.Code;
            for (byte i = 0; i < 8; i++)
                if (numberCode[i] != _code[i])
                    return false;

            return true;
        }
        private void btnAutogenerationBinaryNumbers_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                BinEncoding initEncoding = BinEncoding.GenerateRandomEncoding();
                cbInitialEncoding.Text = initEncoding.ToString();
                _variableByUserBinaryNumber = initEncoding.GenerateRandomBinaryNumber();

                tbInitCode.Text = _variableByUserBinaryNumber.ToString();
                tbEndCode.Text = tbInitCode.Text;

                BinEncoding endEncoding = BinEncoding.GenerateRandomEncoding();
                cbEndEncoding.Text = endEncoding.ToString();
                PrepareComponentsToModifyNumber();
            }
            catch (ArgumentException)
            {
                MessageBox.Show("Неверное значение бинарного числа!", "Ошибка ввода!");
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void ComponentToInitState()
 {
     _variableByUserBinaryNumber = null;
     btnAnew.IsEnabled = false;
     grActions.IsEnabled = false;
     btnCheckRightBinaryNumbers.IsEnabled = false;
     tbInitCode.IsEnabled = true;
     cbInitialEncoding.IsEnabled = true;
     cbEndEncoding.IsEnabled = true;
     btnBegin.IsEnabled = true;
     btnAutogenerationBinaryNumbers.IsEnabled = true;
     btnExchangeEncoding.IsEnabled = true;
     cbInitialEncoding.Text = "";
     cbEndEncoding.Text = "";
     tbInitCode.Text = "";
     tbEndCode.Text = "";
 }
 private void btnBegin_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         _variableByUserBinaryNumber = BinEncoding.StrToBinEncoding(cbInitialEncoding.Text).MakeNumber(tbInitCode.Text.ToCharArray());
         tbEndCode.Text = _variableByUserBinaryNumber.ToString();
         PrepareComponentsToModifyNumber();
     }
     catch (ArgumentException argEx)
     {
         MessageBox.Show(argEx.Message, "Ошибка ввода!");
     }
 }