Ejemplo n.º 1
0
        public void RequestAuthors(SweepNetPage page, long start, long end)
        {
            if (aw == null)
            {
                return;
            }

            if (result != null && result.ready && result.page.title == page.title && start == result.start && end == result.end)
            {
                aw.events.Push("AuthorsReady" + start + "_" + end);
                return;
            }
            result = null;
            if (worker != null && worker.IsAlive)
            {
                try
                {
                    worker.Abort();
                    worker.Join();
                }
                catch { }
            }

            result       = new AuthorsRequestResult();
            result.ready = false;
            result.page  = page;
            result.start = start;
            result.end   = end;
            result.error = false;

            worker = new Thread(MyThreadFunction);
            worker.IsBackground = true;
            worker.Start();
        }
Ejemplo n.º 2
0
        public static string MakeUpTable(AuthorsRequestResult res)
        {
            if (res.error)
            {
                return("<br />" + ("Error. Check, may be the pending changes have been made only by anonymous editors.").T());
            }
            string tmp = "<table class=\"myt\" style=\"margin-top:10px;margin-bottom:10px;\"><tr><td>User</td><td>Edits</td><td>Registration</td><td>Rights</td><td>Banned</td></tr>";

            foreach (AuthorsRequestResultItem item in res.items)
            {
                tmp += "<tr><td>" + Tools.HtmlEncode(item.user) + "</td><td>" + item.edits + "</td><td>" + item.timestamp.Substring(0, 10) + "</td><td>" +
                       string.Join(", ", item.groups.ToArray()) + "</td><td>" + (item.banned?"Yes":"No") + "</td></tr>";
            }
            return(tmp + "</table>");
        }