private void btnGetPosts_Click(object sender, EventArgs e) { if (_voteCount != null) { EnableButtons(false); _voteCount.CheckThread(() => { EnableButtons(true); }); } }
void ReadTurbo(String url) { Int32 _threadId = Misc.TidFromURL(url); ThreadReader t = _forum.Reader(); Action <Action> invoker = a => a(); _count = new ElectionInfo(invoker, t, _db, _forum.ForumURL, url, _forum.PostsPerPage, false, Language.English, "3.8.7"); _count.CheckThread(() => { Console.WriteLine("{0} posts", _count.LastPost); Post p = _db.GetPost(_threadId, 1); ReadPost(p, "OP"); Console.WriteLine("{0} writes... {1}", p.Poster.Name, p.Title); var posts = _db.GetPosts(_threadId, p.Poster.Name); Console.WriteLine("{0} has {1} posts.", p.Poster.Name, posts.Count()); foreach (Post post in posts) { switch (post.Title) { case "Mod: Lynch result": { ReadPost(post, "Lynch"); } break; case "Mod: It is day!": { ReadPost(post, "Day"); } break; case "Mod: Game Over": { ReadPost(post, "End"); } break; case "Vote Count": { ReadPost(post, "VoteCount"); } break; default: { } break; } } }); }
private void BindToNewGame(String url) { url = Utils.Misc.NormalizeUrl(url); ThreadReader t = _forum.Reader(); _voteCount = new ElectionInfo(_synchronousInvoker, t, _db, _forum.ForumURL, url, _forum.PostsPerPage, true, _language, _forum.VBVersion); _voteCount.PropertyChanged += new PropertyChangedEventHandler(_voteCount_PropertyChanged); _voteCount.Turbo = _turbo; _moderator = new Moderator(_synchronousInvoker, _voteCount, _forum); txtLastPost.DataBindings.Clear(); udStartPost.DataBindings.Clear(); txtEndPost.DataBindings.Clear(); dtEndTime.DataBindings.Clear(); dtStartTime.DataBindings.Clear(); txtLastPost.DataBindings.Add("Text", _voteCount, "LastPost", false, DataSourceUpdateMode.OnPropertyChanged); udStartPost.DataBindings.Add("Text", _voteCount, "StartPost", false, DataSourceUpdateMode.OnPropertyChanged); txtEndPost.DataBindings.Add("Text", _voteCount, "EndPost", false, DataSourceUpdateMode.OnPropertyChanged); _voteCount.ChangeDay(_day); _voteCount.Refresh(); EnableButtons(false); _voteCount.CheckThread(() => { EnableButtons(true); }); }