Beispiel #1
0
        public Dictionary <int, Category> getCategories()
        {
            var         list = new List <Category>();
            XmlDocument xml  = this.doRequestXml(m_targetUrl + "?m=20");

            return(WidgetBrowser.xml2Categories(xml));
        }
Beispiel #2
0
        static public WidgetInfo xml2ModWidgetInfo(String xml)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);

            XmlNode root = doc.DocumentElement;

            return(WidgetBrowser.xml2ModWidgetInfo(root.FirstChild));
        }
Beispiel #3
0
 public Nullable <float> getUserRating(string username, string password, int nameId)
 {
     try
     {
         XmlDocument xml  = this.doRequestXml(m_targetUrl + "?m=21" + "&uname=" + username + "&pw=" + password + "&id=" + nameId);
         var         list = WidgetBrowser.xml2Ratings(xml);
         return(list[0]);
     }
     catch
     {
         return(null);
     }
 }
Beispiel #4
0
        static public ArrayList xml2ModList(XmlDocument doc)
        {
            XmlNode     root  = doc.DocumentElement;
            IEnumerator ienum = root.GetEnumerator();
            XmlNode     widgetXml;

            ArrayList list = new ArrayList();

            while (ienum.MoveNext())
            {
                widgetXml = (XmlNode)ienum.Current;
                ModInfoDb info = WidgetBrowser.xml2ModInfo(widgetXml);
                list.Add(info);
            }
            return(list);
        }
Beispiel #5
0
        static public List <Comment> xml2Comments(XmlDocument doc)
        {
            XmlNode     root  = doc.DocumentElement;
            IEnumerator ienum = root.GetEnumerator();
            XmlNode     widgetXml;

            var list = new List <Comment>();

            while (ienum.MoveNext())
            {
                widgetXml = (XmlNode)ienum.Current;
                Comment cmt = WidgetBrowser.xml2Comment(widgetXml);
                list.Add(cmt);
            }
            return(list);
        }
Beispiel #6
0
        static public Dictionary <int, Category> xml2Categories(XmlDocument doc)
        {
            XmlNode     root  = doc.DocumentElement;
            IEnumerator ienum = root.GetEnumerator();
            XmlNode     widgetXml;

            var list = new Dictionary <int, Category>();

            while (ienum.MoveNext())
            {
                widgetXml = (XmlNode)ienum.Current;
                Category info = WidgetBrowser.xml2Category(widgetXml);
                list.Add(info.id, info);
            }
            return(list);
        }
Beispiel #7
0
        static public WidgetList xml2ModWidgets(XmlDocument doc)
        {
            XmlNode     root  = doc.DocumentElement;
            IEnumerator ienum = root.GetEnumerator();
            XmlNode     widgetXml;

            WidgetList list = new WidgetList();

            while (ienum.MoveNext())
            {
                widgetXml = (XmlNode)ienum.Current;
                WidgetInfo info = WidgetBrowser.xml2ModWidgetInfo(widgetXml);
                list.Add(info.id, info);
            }
            return(list);
        }
Beispiel #8
0
        static public LinkedList <FileInfo> xml2FileInfoList(XmlDocument doc)
        {
            XmlNode     root  = doc.DocumentElement;
            IEnumerator ienum = root.GetEnumerator();
            XmlNode     fileXml;

            LinkedList <FileInfo> list = new LinkedList <FileInfo>();

            while (ienum.MoveNext())
            {
                fileXml = (XmlNode)ienum.Current;
                FileInfo info = WidgetBrowser.xml2FileInfo(fileXml);
                list.AddLast(info);
            }
            return(list);
        }
Beispiel #9
0
        //Array of modInfos
        public Dictionary <string, ModInfoDb> getActivationMods()
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=11");
            ArrayList   ar  = WidgetBrowser.xml2ModList(xml);

            Dictionary <string, ModInfoDb> result = new Dictionary <string, ModInfoDb>();

            foreach (ModInfoDb mod in ar)
            {
                try
                {
                    WidgetList modWidgets = this.getModWidgetsByModId(mod.id);
                    mod.modWidgets = modWidgets;
                    result.Add(mod.abbreviation, mod);
                }
                catch
                {
                    //hm what now?
                    //do nothing, nobody will ever know *hrhrhrhrhr*
                }
            }

            return(result);
        }
Beispiel #10
0
        public WidgetList getOverviewList()
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=0");

            return(WidgetBrowser.xml2WidgetList(xml));
        }
Beispiel #11
0
        //WidgetList. But only ID, headerName and headerDescription filled!
        public WidgetList getModWidgetsByModId(int modId)
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=13&id=" + modId);

            return(WidgetBrowser.xml2ModWidgets(xml));
        }
Beispiel #12
0
        //WidgetList. But only ID, headerName and headerDescription filled!
        public WidgetList getModWidgetsAll()
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=12");

            return(WidgetBrowser.xml2ModWidgets(xml));
        }
Beispiel #13
0
        public List <int> getProfileInstallation(string username, string password)
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=18" + "&uname=" + username + "&pw=" + password);

            return(WidgetBrowser.xml2NameIds(xml));
        }
Beispiel #14
0
        public WidgetList getLuasByNameId(int nameId)
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=6&id=" + nameId);

            return(WidgetBrowser.xml2WidgetList(xml));
        }
Beispiel #15
0
        public WidgetList getAllLuas()
        {
            XmlDocument xml = this.doRequestXml(m_baseAdminUrlPoint + "m=9");

            return(WidgetBrowser.xml2WidgetList(xml));
        }
Beispiel #16
0
        public List <Comment> getCommentsByNameId(int nameId)
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=16&id=" + nameId);

            return(WidgetBrowser.xml2Comments(xml));
        }
Beispiel #17
0
        public List <string> getProfileActivation(string username, string password, int modId)
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=19" + "&uname=" + username + "&pw=" + password + "&modId=" + modId);

            return(WidgetBrowser.xml2WidgetNames(xml));
        }
Beispiel #18
0
        public WidgetList getOverviewListWithInactive()
        {
            XmlDocument xml = this.doRequestXml(m_baseAdminUrlPoint + "m=14");

            return(WidgetBrowser.xml2WidgetList(xml));
        }
Beispiel #19
0
        public WidgetList getAllLuasActive()
        {
            XmlDocument xml = this.doRequestXml(m_targetUrl + "?m=3");

            return(WidgetBrowser.xml2WidgetList(xml));
        }