private void OnReplace(object parameter) { var values = (object[])parameter; var textToFind = values[0] as string ?? string.Empty; var replacementText = values[1] as string ?? string.Empty; if (!_findReplaceService.Replace(textToFind, replacementText, FindReplaceSettings)) { SystemSounds.Beep.Play(); } }
public ActionResult Replace(ReplaceModel model) { if (!_orchardServices.Authorizer.Authorize(Permissions.AccessFindReplace, T("Unable to access Find/Replace"))) { return(new HttpUnauthorizedResult()); } _findReplaceService.Replace(model.ItemIds, model.Find, model.Replace); _orchardServices.Notifier.Add(NotifyType.Information, T("Successfully updated {0} content item(s).", model.ItemIds.Count)); return(RedirectToAction("Index")); }