Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
 private string ArticleActionSummary(ArticleActionDialog dlgArticleAction)
 {
     return AddUsingAWBOnArticleAction
                ? dlgArticleAction.Summary + " (" + Variables.SummaryTag.Trim() + ")"
                : dlgArticleAction.Summary;
 }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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);
                }
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
        // 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);
                }
            }
        }