Changeset 18564 for lang/csharp
- Timestamp:
- 09/01/08 09:03:20 (3 months ago)
- Location:
- lang/csharp/MMMMB/MMMMB
- Files:
-
- 3 added
- 9 modified
-
Entry.cs (modified) (1 diff)
-
FavoriteProperty.cs (added)
-
IExtendedProperty.cs (added)
-
MMMMB.csproj (modified) (2 diffs)
-
MiniBlogView.cs (modified) (3 diffs)
-
MiniBlogs/FriendFeed.cs (modified) (1 diff)
-
MiniBlogs/HatenaHaiku.cs (modified) (1 diff)
-
MiniBlogs/Twitter.cs (modified) (1 diff)
-
MiniBlogs/Wassr.cs (modified) (1 diff)
-
favorited.template (added)
-
item.template (modified) (1 diff)
-
main.template (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/MMMMB/MMMMB/Entry.cs
r10019 r18564 46 46 set { image = value; } 47 47 } 48 48 49 private Dictionary<string, IExtendedProperty> extendedProperties = new Dictionary<string, IExtendedProperty>(); 50 51 public Dictionary<string, IExtendedProperty> ExtendedProperties 52 { 53 get { return extendedProperties; } 54 set { extendedProperties = value; } 55 } 49 56 } 50 57 } -
lang/csharp/MMMMB/MMMMB/MMMMB.csproj
r18079 r18564 40 40 <ItemGroup> 41 41 <Compile Include="Entry.cs" /> 42 <Compile Include="FavoriteProperty.cs" /> 42 43 <Compile Include="FileLogger.cs" /> 44 <Compile Include="IExtendedProperty.cs" /> 43 45 <Compile Include="IFavoritable.cs" /> 44 46 <Compile Include="ILogger.cs" /> … … 92 94 <ItemGroup> 93 95 <None Include="app.config" /> 96 <None Include="favorited.template"> 97 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 98 </None> 94 99 <None Include="item.template"> 95 100 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> -
lang/csharp/MMMMB/MMMMB/MiniBlogView.cs
r14118 r18564 183 183 item.SetValue("content", e.Content); 184 184 item.SetValue("time", toShortDate(e.Date)); 185 186 string ex = ""; 187 if (miniBlog is IFavoritable) 188 { 189 FavoriteProperty fav = (FavoriteProperty)e.ExtendedProperties["favorited"]; 190 Template favorited = new Template("favorited"); 191 favorited.SetValue("value", (fav.Favorited ? "on" : "off")); 192 favorited.SetValue("permalink", e.Permalink.ToString()); 193 favorited.SetValue("featurename", ((IFavoritable)miniBlog).FeatureName); 194 ex += favorited.ToString(); 195 } 196 item.SetValue("extended", ex); 197 185 198 sb.Insert(0, item.ToString()); 186 199 } … … 220 233 { 221 234 ContextMenuStrip menu = new ContextMenuStrip(); 222 223 if (miniBlog is IFavoritable)224 {225 IFavoritable favable = (IFavoritable)miniBlog;226 ToolStripItem fav = new ToolStripMenuItem(favable.FeatureName + "(&F)");227 fav.Click += new EventHandler(delegate(object sender, EventArgs e){228 favable.Create(permalink);229 });230 menu.Items.Add(fav);231 menu.Items.Add(new ToolStripSeparator());232 }233 235 234 236 ToolStripItem open = new ToolStripMenuItem("�J��(&O)"); … … 247 249 } 248 250 251 public void FavoriteClick(string permalink) 252 { 253 FavoriteProperty fav = null; 254 foreach (Entry e in entryList) 255 { 256 if (e.Permalink.ToString() == permalink) 257 { 258 fav = (FavoriteProperty)e.ExtendedProperties["favorited"]; 259 } 260 } 261 if (fav == null) return; 262 263 IFavoritable favable = (IFavoritable)miniBlog; 264 if (!fav.Favorited) 265 { 266 favable.Create(permalink); 267 fav.Favorited = true; 268 } 269 else 270 { 271 favable.Destroy(permalink); 272 fav.Favorited = false; 273 } 274 Redraw(); 275 } 276 249 277 public void OnScroll(int scrollY) 250 278 { -
lang/csharp/MMMMB/MMMMB/MiniBlogs/FriendFeed.cs
r13980 r18564 76 76 e.Date = DateTime.Parse(node.SelectSingleNode("pubDate").InnerText); 77 77 e.Image = new Uri(node.SelectSingleNode("ff:user/ff:profileUrl", ns).InnerText + "/picture?size=medium&v=1"); 78 79 // fav 80 FavoriteProperty fav = new FavoriteProperty(); 81 fav.Favorited = false; 82 XmlNodeList likes = node.SelectNodes("ff:likes/ff:like",ns); 83 foreach (XmlNode like in likes) 84 { 85 if (like.SelectSingleNode("ff:user/ff:nickname", ns).InnerText == username) 86 { 87 fav.Favorited = true; 88 break; 89 } 90 } 91 e.ExtendedProperties.Add("favorited", fav); 92 78 93 entryList.Add(e); 79 94 } -
lang/csharp/MMMMB/MMMMB/MiniBlogs/HatenaHaiku.cs
r18372 r18564 73 73 e.Date = DateTime.Parse(node.SelectSingleNode("created_at").InnerText); 74 74 e.Image = new Uri(node.SelectSingleNode("user/profile_image_url").InnerText); 75 76 // fav 77 FavoriteProperty fav = new FavoriteProperty(); 78 //fav.Favorited = (node.SelectSingleNode("favorited").InnerText == "1"); // �����ȊO�̐l���X�^�[����Ă� �ɂȂ��ۂ� 79 fav.Favorited = false; // API �Ŏ������t�����X�^�[�̏�����Ȃ��̂Ŏd�� 80 e.ExtendedProperties.Add("favorited", fav); 81 75 82 entryList.Add(e); 76 83 } -
lang/csharp/MMMMB/MMMMB/MiniBlogs/Twitter.cs
r18427 r18564 69 69 e.Date = DateTime.Parse(times[1] + " " + times[2] + "," + times[5] + " " + times[3] + " " + times[4]); 70 70 e.Image = new Uri(node.SelectSingleNode("user/profile_image_url").InnerText); 71 72 // fav 73 FavoriteProperty fav = new FavoriteProperty(); 74 fav.Favorited = (node.SelectSingleNode("favorited").InnerText == "true"); 75 e.ExtendedProperties.Add("favorited", fav); 76 71 77 entryList.Add(e); 72 78 } -
lang/csharp/MMMMB/MMMMB/MiniBlogs/Wassr.cs
r18372 r18564 70 70 e.Date = new DateTime(1970, 1, 1, 9, 0, 0).AddSeconds(long.Parse(node.SelectSingleNode("epoch").InnerText)); 71 71 e.Image = new Uri("http://wassr.jp/user/" + user + "/profile_img.png.32"); 72 73 // fav 74 FavoriteProperty fav = new FavoriteProperty(); 75 fav.Favorited = false; // API �ŃC�C�l�̏�����Ȃ��̂Ŏd�� 76 e.ExtendedProperties.Add("favorited", fav); 77 72 78 entryList.Add(e); 73 79 } -
lang/csharp/MMMMB/MMMMB/item.template
r10019 r18564 6 6 <span class="time">[[time]]</span> 7 7 <a href="javascript:permalink_click('[[permalink]]');" class="permalink">Permalink</a> 8 [[extended]] 8 9 </h1> 9 10 <p class="content">[[content]]</p> -
lang/csharp/MMMMB/MMMMB/main.template
r18079 r18564 70 70 font-size: 80%; 71 71 } 72 a.favorite_on{ 73 text-decoration: none; 74 color: #f8b836; 75 } 76 a.favorite_off{ 77 text-decoration: none; 78 color: #dcdcdc; 79 } 72 80 p.content{ 73 81 margin: 0; … … 90 98 function permalink_click(permalink){ 91 99 window.external.PermalinkClick(permalink); 100 } 101 function favorite_click(permalink){ 102 window.external.FavoriteClick(permalink); 92 103 } 93 104 window.onload = function(){
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)