Example #1
0
        /// <summary>
        /// The icon legend_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void IconLegend_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            string[] themeImageTags =
            {
                "TOPIC_NEW",        "TOPIC",        "TOPIC_HOT_NEW",  "TOPIC_HOT",  "TOPIC_NEW_LOCKED", "TOPIC_LOCKED", "TOPIC_ANNOUNCEMENT_NEW", "TOPIC_ANNOUNCEMENT",
                "TOPIC_STICKY_NEW", "TOPIC_STICKY", "TOPIC_POLL_NEW", "TOPIC_POLL", "TOPIC_MOVED"
            };

            string[] localizedTags =
            {
                "NEW_POSTS",        "NO_NEW_POSTS", "HOT_NEW_POSTS", "HOT_NO_NEW_POSTS", "NEW_POSTS_LOCKED", "NO_NEW_POSTS_LOCKED",
                "ANNOUNCEMENT_NEW", "ANNOUNCEMENT", "STICKY_NEW",    "STICKY",           "POLL_NEW",         "POLL", "MOVED"
            };

            HtmlTableRow tr = null;

            // add a table control
            var table = new HtmlTable();

            table.Attributes.Add("class", "iconlegend");
            Controls.Add(table);

            for (int i = 0; i < themeImageTags.Length; i++)
            {
                if ((i % 2) == 0 || tr == null)
                {
                    // add <tr>
                    tr = new HtmlTableRow();
                    table.Controls.Add(tr);
                }

                // add this to the tr...
                HtmlTableCell td = new HtmlTableCell();
                tr.Controls.Add(td);

                // add the themed icons
                var themeImage = new ThemeImage {
                    ThemeTag = themeImageTags[i]
                };
                td.Controls.Add(themeImage);

                // space
                var space = new Literal {
                    Text = " "
                };
                td.Controls.Add(space);

                // localized text describing the image
                var localLabel = new LocalizedLabel {
                    LocalizedTag = localizedTags[i]
                };
                td.Controls.Add(localLabel);
            }
        }
Example #2
0
        /// <summary>
        /// The icon legend_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void IconLegend_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            string[] themeImageTags = {
                                          "TOPIC_NEW", "TOPIC", "TOPIC_HOT_NEW", "TOPIC_HOT", "TOPIC_NEW_LOCKED", "TOPIC_LOCKED", "TOPIC_ANNOUNCEMENT_NEW", "TOPIC_ANNOUNCEMENT",
                                          "TOPIC_STICKY_NEW", "TOPIC_STICKY", "TOPIC_POLL_NEW", "TOPIC_POLL", "TOPIC_MOVED"
                                      };

            string[] localizedTags = {
                                         "NEW_POSTS", "NO_NEW_POSTS", "HOT_NEW_POSTS", "HOT_NO_NEW_POSTS", "NEW_POSTS_LOCKED", "NO_NEW_POSTS_LOCKED",
                                         "ANNOUNCEMENT_NEW", "ANNOUNCEMENT", "STICKY_NEW", "STICKY", "POLL_NEW",  "POLL", "MOVED"
                                     };

            HtmlTableRow tr = null;

            // add a table control
            var table = new HtmlTable();
            table.Attributes.Add("class", "iconlegend");
            Controls.Add(table);

            for (int i = 0; i < themeImageTags.Length; i++)
            {
                if ((i % 2) == 0 || tr == null)
                {
                    // add <tr>
                    tr = new HtmlTableRow();
                    table.Controls.Add(tr);
                }

                // add this to the tr...
                HtmlTableCell td = new HtmlTableCell();
                tr.Controls.Add(td);

                // add the themed icons
                var themeImage = new ThemeImage { ThemeTag = themeImageTags[i] };
                td.Controls.Add(themeImage);

                // space
                var space = new Literal { Text = " " };
                td.Controls.Add(space);

                // localized text describing the image
                var localLabel = new LocalizedLabel { LocalizedTag = localizedTags[i] };
                td.Controls.Add(localLabel);
            }
        }