implemented clear all button

This commit is contained in:
Lynne Megido 2020-09-05 17:42:51 +10:00
parent ef75c63aa2
commit 49119fc6dc
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

View File

@ -418,13 +418,14 @@ namespace Buypeeb {
aid.Dispose();
// vry simpl url validation for simpol creachers
// TODO: better. do better.
Regex rx = new Regex(@"^http.+yahoo.+");
if (rx.IsMatch(url)) {
this.UpdateItem(this.settings.Watch(url, name).id);
this.RenderList();
}
else {
var md = this.MsgBox($"\"{url}\" is not a valid Buyee or Yahoo! Auctions Japan URL.");
var md = this.MsgBox($"\"{url}\" is not a valid Buyee or Yahoo! Auctions Japan URL.", ButtonsType.Ok);
md.Run();
md.Dispose();
}
@ -457,7 +458,12 @@ namespace Buypeeb {
}
private void ButtonClearAllClicked(object sender, EventArgs a) {
Console.WriteLine("ButtonClearAllClicked");
var md = this.MsgBox("Are you sure you want to clear ALL items?");
if (md.Run() == (int)ResponseType.Ok) {
this.settings.watchlist.Clear();
this.RenderList();
}
md.Dispose();
}
private void ButtonOpenClicked(object sender, EventArgs a) {