Exemple #1
0
        private void getBoxMessages(String box)
        {
            String forumName;
            int siteNum = 1;

            forums.Clear();
            while ((forumName = UserSettings.getValue("Site" + siteNum.ToString())) != String.Empty)
            {
                String boxId = UserSettings.getValue("Site" + siteNum.ToString() + "." + box);
                String forumUrl = UserSettings.getValue("Site" + siteNum.ToString() + ".Url");

                if(boxId != String.Empty)
                {
                    Forum f = new Forum(forumName, forumUrl);

                    forums.Add(f);
                    String username = UserSettings.getValue("Site" + siteNum.ToString() + ".User");
                    String password = UserSettings.getValue("Site" + siteNum.ToString() + ".Pwd");
                    f.login(username, password);

                    int totalMessages = f.loadMessages(boxId, 0, 49);
                    int messagesLoaded;
                    if(totalMessages > 50)
                        messagesLoaded = 50;
                    else
                        messagesLoaded = totalMessages;

                    for (int i=0; i<messagesLoaded && i<50; i++)
                    {
                        treestoreMessages.AppendValues(siteNum.ToString (), f.getMessageId(i), f.forumName, f.getMessageUser(i), f.getMessageSubject(i), f.getMessageSentDate(i).ToString("u").Substring(0, 19));
                    }
                }
                siteNum++;
            }
        }