private void ClculateCheck() { byte[] data; string str = textBoxMainEdit.Text; str = str.Replace(" ", ""); try { if (radioBtnAsciiMode.Checked == false) { data = ConvertArray.AsciiToHex(str.ToArray()); } else { data = ConvertArray.CharToByte(str.ToArray()); } } catch (ArgumentOutOfRangeException) { textBoxResult.Text = "OutOfRange"; return; } switch (comboBoxVerifyMode.SelectedIndex) { case 0: textBoxResult.Text = SumCheck.GetCheck(data).ToString("X2"); break; case 1: textBoxResult.Text = XorCheck.GetCheck(data).ToString("X2"); break; case 2: textBoxResult.Text = LrcCheck.GetCheck(data).ToString("X2"); break; case 3: textBoxResult.Text = CrcCheck.GetCheck(data).ToString("X2"); break; case 4: textBoxResult.Text = "Not Implemented"; break; default: textBoxResult.Text = "ERROR"; break; } }
public static double[] orderNumsReverse(decimal[] numsarray) { double[] nums = ConvertArray.ToDoubleArray(numsarray); double[] orderedNums = { }; int count = 0; orderedNums = new double[nums.Length]; for (int i = 0; i < nums.Length; i++) { count = 0; for (int j = 0; j < nums.Length; j++) { if (nums[i] < nums[j]) { count++; } } orderedNums[count] = nums[i]; } for (int i = orderedNums.Length - 1; i > 0; i--) { if (orderedNums[i] == 0) { bool f = false; for (int x = i; f == false; x--) { if (orderedNums[x] != 0) { orderedNums[i] = orderedNums[x]; f = true; } } } } return(orderedNums); }
public HitFeeder() { _convertArray = new ConvertArray(); _serializer = new JavaScriptSerializer(); _listProperties = new ListProperties <T>(); }