Changeset 18564 for lang/csharp/MMMMB/MMMMB/MiniBlogView.cs
- Timestamp:
- 09/01/08 09:03:20 (4 months ago)
- Files:
-
- 1 modified
-
lang/csharp/MMMMB/MMMMB/MiniBlogView.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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 {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)