コード例 #1
0
        private void buttonBrowse_Click(object sender, RoutedEventArgs e)
        {
            Tuple <string, string> getValue = CountClass.OpenFile();

            try
            {
                txtMain.Text    = getValue.Item1;
                lblPath.Content = getValue.Item2;
            }
            catch (System.NullReferenceException) { }
        }
コード例 #2
0
 private void buttonCount_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         lblNResult.Content      = CountClass.GetWordsByLength(txtMain.Text, Int32.Parse(txtNCount.Text));
         lblLetterResult.Content = CountClass.GetCharacterOccurrences(txtMain.Text, Convert.ToChar(txtLetterRepeat.Text));
     }
     catch (FormatException)
     {
         MessageBox.Show("Format Exception. Please, check entered data.");
     }
 }