///
" );
writer.WriteLine( " " ); // Check if the resource has some Link/URL property (this is some heuristics …) string sLinkProp = null; // Name of the link prop, if any found foreach( string sProposedLinkProp in new string[] {"Link", "Uri", "Url", "URI", "URL"} ) { if( !Core.ResourceStore.PropTypes.Exist( sProposedLinkProp ) ) continue; // Skip the illegal properties if( item.HasProp( sProposedLinkProp ) ) { sLinkProp = sProposedLinkProp; break; } } // Write the link/text if( sLinkProp != null ) // Open the anchor tag that makes the link writer.Write( "", HttpUtility.HtmlEncode( item.GetPropText( sLinkProp ) ) ); // Icon RenderIcon( item, writer ); // Icon // Text of the subject: if the item has a subject, use it; otherwise, take the display name writer.WriteLine( item.HasProp( Core.Props.Subject ) ? item.GetPropText( Core.Props.Subject ) : item.DisplayName ); // Flag & Category (write to a string) StringWriter swFlagCat = new StringWriter(); RenderFlag( item, swFlagCat ); RenderCategoryIcon( item, swFlagCat ); // End the link (if it was opened) if( sLinkProp != null ) writer.Write( "" ); writer.WriteLine( " " ); // End the Subject paragraph // Prepare the Date — date/time of this item string sDate = ""; if( item.HasProp( Core.Props.Date ) ) { DateTime date = item.GetDateProp( Core.Props.Date ); if( date.Date == DateTime.Today ) // Special treatment for the Today's date sDate = "Today " + date.ToShortTimeString(); else sDate = date.ToShortDateString() + ' ' + date.ToShortTimeString(); } // Prepare the Origin — name of the feed author, etc string sOrigin = ""; if( item.HasProp( Core.ContactManager.Props.LinkFrom ) ) sOrigin = HttpUtility.HtmlEncode( item.GetPropText( Core.ContactManager.Props.LinkFrom ) ); // Finally, write the Origin-Date block (if available) if( (sDate.Length > 0) || (sOrigin.Length > 0) || (swFlagCat.ToString().Length > 0) ) writer.WriteLine( "{3}{4}{0}{2}{1} ", sOrigin, sDate, ((sOrigin.Length > 0) && (sDate.Length > 0) ? " — " : ""), swFlagCat.ToString(), (swFlagCat.ToString().Length > 0 ? " " : "") ); // Origin (feed name) & Date writer.WriteLine( " | " );
///////////////
// Annotation
string sAnnotation = item.HasProp( Core.Props.Annotation ) ? item.GetPropText( Core.Props.Annotation ) : ""; // Annotation text, or an empty string if it's not defined
writer.WriteLine( "", (sAnnotation.Length > 0 ? "Annotation" : "") ); // Do not assign a class if there's no annotation, so that the cell would be invisible writer.WriteLine( HttpUtility.HtmlEncode( sAnnotation ) ); writer.WriteLine( " | " ); writer.WriteLine( "