예제 #1
0
 private void sf_button2_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         string msg = SF.Decode(sf_textBox_c.Text);
         sf_textBox_d.Text = msg;
     }
     catch
     {
         sf_listBox.Items.Clear();
         sf_textBox1.Clear();
         sf_textBox_c.Clear();
         sf_textBox_d.Clear();
         sf_textBlock.Text = "Shannon-Fano";
     }
 }
예제 #2
0
 private void sf_button1_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         string arch = SF.Encode(this.sf_textBox1.Text);
         this.sf_listBox.Items.Clear();
         for (int i = 0; i < SF.Table.Count; i++)
         {
             this.sf_listBox.Items.Add(SF.Table[i].ToString());
         }
         sf_textBox_c.Text = arch;
     }
     catch
     {
         sf_listBox.Items.Clear();
         sf_textBox1.Clear();
         sf_textBox_c.Clear();
         sf_textBox_d.Clear();
         sf_textBlock.Text = "Shannon-Fano";
     }
 }