Example #1
0
        internal static StalkLogItem newFromXmlElement(XmlElement element)
        {
            StalkLogItem sli = new StalkLogItem
                                   {
                                       stalk = element.GetAttribute("stalkflag"),
                                       ts = DateTime.Parse(element.GetAttribute("timestamp"))
                                   };

            string user, page, url, summary, flags, sizediff;
            user = page = url = summary = flags = "";
            sizediff = "0";
            foreach (XmlNode childNode in element.ChildNodes)
            {
                XmlElement ce = (XmlElement) childNode;
                if (ce.Name == "user")
                    user = ce.GetAttribute("value");
                if (ce.Name == "page")
                    page = ce.GetAttribute("value");
                if (ce.Name == "url")
                    url = ce.GetAttribute("value");
                if (ce.Name == "summary")
                    summary = ce.GetAttribute("value");
                if (ce.Name == "flags")
                    flags = ce.GetAttribute("value");
                if (ce.Name == "sizediff")
                    sizediff = ce.GetAttribute("value");

            }

            RecentChange rc = new RecentChange(page, user, url, summary, flags, int.Parse(sizediff));
            sli.rc = rc;
            return sli;
        }
 public void LogStalkTrigger(string s, RecentChange rc)
 {
     StalkLogItem sli = new StalkLogItem(s,rc);
     stalklog.Add(sli);
     this.save();
 }