Beispiel #1
0
 public static void WriteArticleList(TextWriter writer, Category category, int numArticles, bool left)
 {
     string boxClass = left ? "leftbox" : "rightbox";
     writer.WriteLine("<div class=\"" + boxClass + "\">");
     writer.WriteLine("<div class=\"category\">" + category.Name + "</div>");
     WriteArticleListSub(writer, category, numArticles, false, false);
     writer.WriteLine("</div>");
 }
Beispiel #2
0
 public static void WriteHalfWindow(TextWriter writer, Category category, bool left)
 {
     string boxClass = left ? "leftbox" : "rightbox";
     writer.WriteLine("<div class=\"" + boxClass + "\">");
     writer.WriteLine("<span class=\"titlebar\">" + category.Name + "</span>");
     writer.WriteLine("<div class=\"halfwindow\">");
     WriteArticleListSub(writer, category, Settings.SubCategoryNumArticles, true, false);
     writer.WriteLine("</div>");
     writer.WriteLine("</div>");
 }
Beispiel #3
0
 internal Blog(Category category, string rssUri)
 {
     this.category = category;
     this.rssUri = rssUri;
     articleSet = new SortedSet<Article>(Article.IDOrder);
     try
     {
         Reload();
     }
     catch (Exception e)
     {
         Log.WriteLine("RSS[" + rssUri + "]の取得に失敗", false);
         Log.WriteException(e);
     }
 }
Beispiel #4
0
 public static void WriteLargeWindow(TextWriter writer, Category category)
 {
     writer.WriteLine("<span class=\"titlebar\">" + category.Name + "</span>");
     writer.WriteLine("<div class=\"largewindow\">");
     WriteArticleListSub(writer, category, Settings.MainCategoryNumArticles, true, true);
     writer.WriteLine("</div>");
 }
Beispiel #5
0
        private static void WriteArticleListSub(TextWriter writer, Category category, int numArticles, bool addDateTime, bool addBlogTitle)
        {
            writer.WriteLine("<table class=\"articlelist\">");

            int i = 0;
            int day = 0;
            foreach (ArticleBundle bundle in category.ArticleBundles)
            {
                if (addDateTime && bundle.MainArticle.Date.Day != day)
                {
                    writer.WriteLine("<tr><td class=\"date\" colspan=\"2\">" + bundle.MainArticle.Date.ToString("MM/dd") + "</td></tr>");
                    day = bundle.MainArticle.Date.Day;
                }

                writer.Write("<tr>");
                if (addDateTime)
                {
                    writer.Write("<td class=\"time\">" + bundle.MainArticle.Date.ToString("HH:mm") + "</td>");
                }
                writer.Write("<td>");
                int j = 0;
                foreach (Article article in bundle.Articles)
                {
                    if (j == 0)
                    {
                        string title = article.Title;
                        if (title.Length == 0)
                        {
                            title = "無題";
                        }
                        writer.Write(CreateLink(article.Uri, title, "article", article.Blog.Title));
                    }
                    else
                    {
                        writer.Write(" " + CreateLink(article.Uri, "●", "duplicate", article.Blog.Title));
                    }
                    j++;
                }
                writer.Write("</td>");
                if (addBlogTitle)
                {
                    writer.Write("<td class=\"blogtitle\">" + CreateLink(bundle.MainArticle.Blog.Uri, bundle.MainArticle.Blog.Title, "article") + "</td>");
                }
                writer.WriteLine("</tr>");

                i++;
                if (i >= numArticles)
                {
                    break;
                }
            }

            writer.WriteLine("</table>");
        }