From 5eed9b12add17b02efa34b85cb6586250cc74148 Mon Sep 17 00:00:00 2001 From: Zhao Cheng Date: Tue, 6 Mar 2012 12:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E9=9D=A2=E6=B8=85=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BoardPage.xaml | 1 + BoardPage.xaml.cs | 9 +++++++++ Sbbs/Service.cs | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/BoardPage.xaml b/BoardPage.xaml index 2355e0b..47b69f3 100644 --- a/BoardPage.xaml +++ b/BoardPage.xaml @@ -79,6 +79,7 @@ + diff --git a/BoardPage.xaml.cs b/BoardPage.xaml.cs index 09d9d72..503d222 100644 --- a/BoardPage.xaml.cs +++ b/BoardPage.xaml.cs @@ -73,6 +73,15 @@ private void Settings_Click(object sender, EventArgs e) NavigationService.Navigate(new Uri("/BoardSettingsPage.xaml", UriKind.Relative)); } + private void Clear_Click(object sender, EventArgs e) + { + App.Service.BoardMarkRead(App.ViewModel.CurrentBoard.EnglishName); + foreach (TopicViewModel topic in App.ViewModel.CurrentBoard.Topics) + { + topic.Unread = false; + } + } + private void LoadMore_Click(object sender, RoutedEventArgs e) { App.ViewModel.CurrentBoard.IsLoaded = false; diff --git a/Sbbs/Service.cs b/Sbbs/Service.cs index 347a538..055fb1b 100644 --- a/Sbbs/Service.cs +++ b/Sbbs/Service.cs @@ -76,6 +76,14 @@ public void Board(string board, int mode, int start, int limit, Action() { Callback = callback }); } + // 版面标记已读 + public void BoardMarkRead(string board) + { + WebClient wc = new WebClient(); + Uri uri = new Uri(apiBase + "board/" + board + "/markread" + apiPost + "?token=" + HttpUtility.UrlEncode(Token)); + wc.DownloadStringAsync(uri); + } + // 获取话题 public void Topic(string board, int id, int start, int limit, Action callback) {