public void Initialize() { String host = "forumserver.twoplustwo.com"; _synchronousInvoker = a => Gtk.Application.Invoke(delegate { a.Invoke(); }); _forum = new TwoPlusTwoForum(_synchronousInvoker, host); _forum.LoginEvent += HandleLoginEvent; _db = new PogSqlite(); String dbPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/pog"; System.IO.Directory.CreateDirectory(dbPath); String dbName = dbPath + "/pogposts.sqlite"; _db.Connect(dbName); Gtk.Dialog dlg = null; try { dlg = new LoginDialog(_forum); dlg.Run(); } finally { if (dlg != null) { dlg.Destroy(); } } }
public Titan() { InitializeComponent(); txtVersion.Text = String.Format("Version {0}", AssemblyVersion); String host = "forumserver.twoplustwo.com"; _synchronousInvoker = a => Invoke(a); _forum = new VBulletinForum(_synchronousInvoker, host, "3.8.7", Language.English, "59/puzzles-other-games/"); _forum.LoginEvent += new EventHandler <LoginEventArgs>(_forum_LoginEvent); txtUsername.Text = PogSettings.Read("TitanModName"); txtPassword.Text = PogSettings.Read("TitanModPassword"); String dbPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/pog/"; System.IO.Directory.CreateDirectory(dbPath); String dbName = String.Format("{0}posts.{1}.sqlite", dbPath, host); _db = new PogSqlite(); _db.Connect(dbName); Action <Action> invoker = a => a(); _autoComplete = new AutoComplete(_forum, invoker, _db); }
void FoxParent_Load(object sender, EventArgs e) { _synchronousInvoker = a => Invoke(a); //String host = "forumserver.twoplustwo.com"; String host = _forumName; String forumRoot = ""; String lobby; String vbVersion; String voteRegex = ""; String voteColor = ""; switch (host) { case "www.flashflashrevolution.com": { vbVersion = "3.8.1"; lobby = "forumdisplay.php?f=47"; _language = Language.English; forumRoot = "/vbz"; voteColor = "red"; } break; case "foorum.pokkeriprod.com": { vbVersion = "4.2.0"; lobby = "forumdisplay.php/9-Võistlused"; _language = Language.Estonian; } break; case "mindromp.org": { vbVersion = "3.8.7"; lobby = "forumdisplay.php?f=17"; _language = Language.English; forumRoot = "/forum"; voteRegex = "##(.*)##"; } break; case "www.millenniumforums.com": { vbVersion = "4.2.0"; lobby = "forumdisplay.php?59-The-Mafia-Forum"; _language = Language.English; voteRegex = "##(.*)"; } break; default: { vbVersion = "3.8.7"; lobby = "59/puzzles-other-games/"; _language = Language.English; _lobbyIcons = new List <String> { "Spade", "Club" }; } break; } String dbPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\pog\"; System.IO.Directory.CreateDirectory(dbPath); String dbName = String.Format("{0}posts.{1}.sqlite", dbPath, host); _db = new PogSqlite(); _db.Connect(dbName); _forum = new VBulletinForum(_synchronousInvoker, host, vbVersion, _language, lobby, forumRoot, voteRegex, voteColor); _forum.LoginEvent += new EventHandler <LoginEventArgs>(_forum_LoginEvent); String username = PogSettings.Read("username", String.Empty); String password = PogSettings.Read("password", String.Empty); if ((username != String.Empty) && (password != String.Empty)) { _forum.Login(username, password); } else { ShowLogin(); } }