• R/O
  • HTTP
  • SSH
  • HTTPS

d2dbench: 提交


Commit MetaInfo

修訂e87fe11505e8105dcf64183bcb7ed70d73f37f4d (tree)
時間2012-10-30 07:21:55
作者konekoneko <jbh03215@hotm...>
Commiterkonekoneko

Log Message

コンボボックスに値を入力して実行すると例外が起きるバグを修正した

Change Summary

差異

--- a/D2DBench/Form1.cs
+++ b/D2DBench/Form1.cs
@@ -27,10 +27,8 @@ namespace D2DBench
2727
2828 private void button1_Click(object sender, EventArgs e)
2929 {
30- int maxcount = Int32.Parse(this.comboBox1.SelectedItem.ToString());
31- int loopCountAtOneLoop = 50;
32- if(this.comboBox2.SelectedItem != null)
33- loopCountAtOneLoop = Int32.Parse(this.comboBox2.SelectedItem.ToString());
30+ int maxcount = GetIntFromComoboBox(this.comboBox1);
31+ int loopCountAtOneLoop = GetIntFromComoboBox(this.comboBox2);
3432
3533 this.listView1.Items.Clear();
3634
@@ -72,6 +70,14 @@ namespace D2DBench
7270 benchFrom.Close();
7371 }
7472
73+ private int GetIntFromComoboBox(ComboBox box)
74+ {
75+ if (box.SelectedItem == null)
76+ return int.Parse(box.Text);
77+ else
78+ return int.Parse(box.SelectedItem.ToString());
79+ }
80+
7581 private Form2 CreateBenchForm()
7682 {
7783 Form2 benchFrom = new Form2();
Show on old repository browser