Exemplo n.º 1
0
        private void DelCustom_Click(object sender, EventArgs e)
        {
            Greyout();
            Prod prod1 = new Prod();
            prod1.prod();
            prod1.ShowDialog();

            if (doprod)
            {
                string reason = prodreasonstr;
                prodreasonstr = "";
                if (string.IsNullOrEmpty(reason))
                {
                    reason = "No reason given";
                }
                if (SortLogin())
                    wf.Deletepg(page2, "Old [[WP:PROD]] - reason given was \"" + reason + "\".  Using [[WP:NPW|NPWatcher]]");

                Greyin();
                doprod = false;
            }
        }
Exemplo n.º 2
0
        private void prodBtn_Click(object sender, EventArgs e)
        {
            Greyout();
            Removetags();
            Prod prodreason = new Prod();
            prodreason.ShowDialog();

            if (doprod)
            {
                MarkPatrolled();
                string message = prodreasonstr;

                string oldtxt = wf.GetWikiText(page2);
                string newtxt = oldtxt;
                string prod = "{{subst:prod|" + message + "}}\r\n";
                newtxt = prod + newtxt;

                Save(page2, newtxt, "[[WP:PROD|PRODDING]] article with [[WP:NPW|NPWatcher]]");

                if (editsuccess)
                {
                    string user = wf.GetCreator(page2);
                    user = "******" + user;
                    string userpage = wf.GetWikiText(user);

                    string userpagenew = userpage + "\r\n{{subst:PRODWarning|" + HttpUtility.UrlDecode(page2) + "}} ~~~~";
                    if (SortLogin())
                        wf.Save(user, userpagenew, "Warning user of prodding using [[WP:NPW|NPWatcher]]");
                    doprod = false;
                }
            }
            doprod = false;

            Greyin();
        }
Exemplo n.º 3
0
        private void RmvProd_Click(object sender, EventArgs e)
        {
            Greyout();
            string wikitext = wf.GetWikiText(page2);
            if (wikitext.Contains("{{dated prod|concern = "))
            {
                try
                {
                    int startindex = wikitext.IndexOf("{{dated prod|concern = ");
                    int endindex = wikitext.IndexOf("emplate directly; the above line is generated by \"subst:prod|reason\" -->" + 72);
                    string prod = wikitext.Substring(startindex, endindex - startindex);
                    // wikitext.Remove(startindex, endindex - startindex);
                    wikitext = wikitext.Replace(prod, "");

                    Prod prod1 = new Prod();
                    prod1.ShowDialog();
                    if (doprod)
                    {
                        string reason = prodreasonstr;
                        prodreasonstr = "";
                        if (string.IsNullOrEmpty(reason))
                        {
                            reason = "No reason given";
                        }
                        Save(page2, wikitext, "Removing prod tag using [[WP:NPW|NPWatcher]].  Reason given was \"" + reason + "\"");
                        doprod = false;
                    }
                }
                catch (ArgumentNullException)
                {
                    MessageBox.Show("Prod reason not found - please choose another option");
                }
            }
            else
            {
                MessageBox.Show("Prod reason not found - please choose another option");
            }
            Greyin();
        }
Exemplo n.º 4
0
        private void IotherBtn_Click(object sender, EventArgs e)
        {
            Greyout();
            if (page2.Contains("Image:"))
            {
                Prod reason = new Prod();
                reason.ShowDialog();
                if (doprod)
                {
                    string rat = prodreasonstr;
                    prodreasonstr = "";
                    if (string.IsNullOrEmpty(rat))
                    {
                        rat = "No reason given";
                    }

                    if (orphanCB.Checked) { OrphanImage(page2, rat); }
                    Delete(page2, rat);
                    webBrowser1.Refresh();
                    doprod = false;
                }
            }
            else
            {
                MessageBox.Show("Please select an image from the list on the left");
            }
            Greyin();
        }