private void ButtonEncode_Click(object sender, RoutedEventArgs e) { TextBlockLeftCharsCount.Text = TextBoxLeft.Text.Length.ToString(); var begin = DateTime.Now; TextBoxRight.Text = RLE.Encode(TextBoxLeft.Text); var end = DateTime.Now; TextBlockRightCharsCount.Text = TextBoxRight.Text.Length.ToString(); TextBlockTime.Text = (end - begin).TotalSeconds.ToString(); }
private void ButtonDecode_Click(object sender, RoutedEventArgs e) { try { TextBlockRightCharsCount.Text = TextBoxRight.Text.Length.ToString(); var begin = DateTime.Now; TextBoxLeft.Text = RLE.Decode(TextBoxRight.Text); var end = DateTime.Now; TextBlockLeftCharsCount.Text = TextBoxLeft.Text.Length.ToString(); TextBlockTime.Text = (end - begin).TotalSeconds.ToString(); } catch (Exception ex) { MessageBox.Show("Błąd. Niepoprawna struktura pliku."); } }