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); }
public ElectionInfo(Action <Action> synchronousInvoker, ThreadReader t, IPogDb db, String forum, String url, Int32 postsPerPage, Boolean noLynchAllowed, Language language, String vbVersion) { _synchronousInvoker = synchronousInvoker; _forumURL = forum; _url = url; _postsPerPage = postsPerPage; _noLynchAllowed = noLynchAllowed; _language = language; _vbVersion = vbVersion; _threadId = VBulletinForum.ThreadIdFromUrl(url); _day = 1; DateTime now = DateTime.Now; _endTime = new DateTime(now.Year, now.Month, now.Day, 18, 0, 0, now.Kind); _thread = t; _thread.PageCompleteEvent += new EventHandler <PageCompleteEventArgs>(_thread_PageCompleteEvent); _thread.ReadCompleteEvent += new EventHandler <ReadCompleteEventArgs>(_thread_ReadCompleteEvent); _db = db; _db.WriteThreadDefinition(_threadId, url, false); if (forum.Contains("mindromp.org")) { _final = true; } }
public FormVoteCounter(VBulletinForum forum, Action <Action> synchronousInvoker, IPogDb db, String url, Boolean turbo, Int32 day, Language language) : this() { _forum = forum; _synchronousInvoker = synchronousInvoker; _db = db; _url = url; _turbo = turbo; _day = day; _language = language; }
public VoteCountWidget(TwoPlusTwoForum forum, Action <Action> synchronousInvoker, IPogDb db, String url, Boolean turbo, Int32 day) { _forum = forum; _synchronousInvoker = synchronousInvoker; _db = db; _url = url; _turbo = turbo; _day = day; _forumURL = _forum.ForumURL; this.Build(); _autoComplete = new AutoComplete(_forum, _synchronousInvoker, _db); BindToNewGame(_url); SetupVoteGrid(); FillVoteGrid(); }
public AutoComplete(VBulletinForum forum, Action <Action> synchronousInvoker, IPogDb db) { _forum = forum; _synchronousInvoker = synchronousInvoker; _db = 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(); } }