private string ArticleActionSummary(ArticleActionDialog dlgArticleAction) { return AddUsingAWBOnArticleAction ? dlgArticleAction.Summary + " (" + Variables.SummaryTag.Trim() + ")" : dlgArticleAction.Summary; }
private void ProtectArticle() { using (ArticleActionDialog dlgArticleAction = new ArticleActionDialog(ArticleAction.Delete)) { try { dlgArticleAction.Summary = LastProtect; if (dlgArticleAction.ShowDialog(this) == DialogResult.OK) { LastProtect = dlgArticleAction.Summary; webBrowserEdit.ProtectPage(TheArticle.Name, ArticleActionSummary(dlgArticleAction), dlgArticleAction.EditProtectionLevel, dlgArticleAction.MoveProtectionLevel, dlgArticleAction.ProtectExpiry, dlgArticleAction.CascadingProtection); } } catch (Exception ex) { ErrorHandler.Handle(ex); } } }
private void DeleteArticle() { using (ArticleActionDialog dlgArticleAction = new ArticleActionDialog(ArticleAction.Delete)) { try { dlgArticleAction.Summary = LastDelete; if (dlgArticleAction.ShowDialog(this) == DialogResult.OK) { LastDelete = dlgArticleAction.Summary; webBrowserEdit.DeletePage(TheArticle.Name, ArticleActionSummary(dlgArticleAction)); } } catch (Exception ex) { ErrorHandler.Handle(ex); } } }
private void DeleteArticle() { dlgArticleAction = new ArticleActionDialog(2); try { dlgArticleAction.Summary = LastDelete; if (dlgArticleAction.ShowDialog(this) == DialogResult.OK) { LastDelete = dlgArticleAction.Summary; webBrowserEdit.DeletePage(TheArticle.Name, ArticleActionSummary); } } catch (Exception ex) { ErrorHandler.Handle(ex); } finally { dlgArticleAction.Dispose(); } }
private void MoveArticle() { dlgArticleAction = new ArticleActionDialog(1); try { dlgArticleAction.NewTitle = TheArticle.Name; dlgArticleAction.Summary = LastMove; if (dlgArticleAction.ShowDialog(this) == DialogResult.OK) { LastMove = dlgArticleAction.Summary; webBrowserEdit.MovePage(TheArticle.Name, dlgArticleAction.NewTitle, ArticleActionSummary); } } catch (Exception ex) { ErrorHandler.Handle(ex); } finally { dlgArticleAction.Dispose(); } }
// TODO: Since this is essentially/conceptually Article.Delete(), Article.Move() etc shouldn't this region be encapsulated? private void MoveArticle() { using (ArticleActionDialog dlgArticleAction = new ArticleActionDialog(ArticleAction.Move)) { try { dlgArticleAction.NewTitle = TheArticle.Name; dlgArticleAction.Summary = LastMove; if (dlgArticleAction.ShowDialog(this) == DialogResult.OK) { LastMove = dlgArticleAction.Summary; TheSession.Editor.Move(TheArticle.Name, dlgArticleAction.NewTitle, ArticleActionSummary(dlgArticleAction), true /* probably wants dealing with on dialog*/, dlgArticleAction.NoRedirect, dlgArticleAction.Watch); } } catch (Exception ex) { ErrorHandler.Handle(ex); } } }