private void buildDropDowns() { // Rune Colour string[] colourNames = new TH1Helper().runeColourNameArray; comboColour.Items.Clear(); comboColour.ItemsSource = colourNames; // Paint Colour string[] paintColours = new TH1PaintCollection().paintNameArray(); comboPaint.Items.Clear(); comboPaint.ItemsSource = paintColours; }
private void btnOK_Click(object sender, RoutedEventArgs e) { MainWindow _mwin = (MainWindow)((EditorWindow)this.Owner)._mainWindow; ; TH1PaintCollection _paintCollection = new TH1PaintCollection(); string[] runeParts = ((string)comboBonus.SelectedItem).Split(':'); TH1RuneM newRune = runeCollection.findRune(new TH1Helper().getRuneColourID((string)comboColour.SelectedValue), int.Parse(runeParts[0])); thisRune = new TH1RuneMExt(newRune); try { thisRune.purchased = (uint)((bool)checkPurchased.IsChecked ? 1 : 0); } catch { thisRune.purchased = 0; } try { thisRune.dataB = (uint)((bool)chkUnknown.IsChecked ? 1 : 0); } catch { thisRune.purchased = 0; } try { thisRune.valueModifier = uint.Parse(txtBaseValue.Text); } catch { thisRune.valueModifier = 10000; } try { thisRune.dataD = uint.Parse(txtD.Text); } catch { thisRune.dataD = 0; } try { thisRune.paint = _paintCollection.findPaint((string)comboPaint.SelectedItem); } catch { thisRune.paint = new TH1Paint(); } this.DialogResult = true; }