public NameFilterEditor(Filter filter) { InitializeComponent(); if (filter.Type != FilterType.Name) throw new Exception("Tried to edit a filter with type " + filter.Type + " as a name"); NFilter = (NameFilter)filter; if (string.IsNullOrWhiteSpace(NFilter.soundName)) txtSound.Text = "sound.wav"; else txtSound.Text = NFilter.soundName; txtName.Text = NFilter.Name; txtNameFilter.Text = NFilter.nameFilter; }
public ItemFilterEditor(Filter inFilter) { InitializeComponent(); if (inFilter.Type != FilterType.Item) throw new Exception("Tried to edit a filter of type " + inFilter.Type + " in the item editor!"); this.filter = (ItemFilter)inFilter; txtName.Text = filter.Name; txtMinLVL.Text = filter.MinLVL.ToString(); if (string.IsNullOrWhiteSpace(filter.soundName) == false) txtSound.Text = filter.soundName; else txtSound.Text = "sound.wav"; boxQuality.Items.AddRange(Enum.GetNames(typeof(ItemQuality))); boxQuality.SelectedItem = Enum.GetName(typeof(ItemQuality), filter.Quality); UpdateListBoxes(); }