private void FindingApm(object sender, WidgetIdEventArgs e) { BeginEventHandler beginAsync = (sa, ea, cb, state) => BeginFind(e.Id, sa, ea, cb, state); AsyncManager.RegisterAsyncTask(beginAsync, EndFind, null); AsyncManager.ExecuteRegisteredAsyncTasks(); }
private void DeletingWidget(object sender, WidgetIdEventArgs e) { var widget = _dbContext.Widgets.Find(e.Id); if (widget != null) { _dbContext.Widgets.Remove(widget); _dbContext.SaveChanges(); } }
private void Finding(object sender, WidgetIdEventArgs e) { using (var context = new MvpWebFormsContext()) { var widget = context.Widgets.Find(e.Id); if (widget != null) { View.Model.Widgets.Add(widget); View.Model.ShowResult = true; } } }
private void FindingTap(object sender, WidgetIdEventArgs e) { AsyncManager.RegisterAsyncTask(() => FindingAsync(e.Id)); AsyncManager.ExecuteRegisteredAsyncTasks(); }