Example #1
0
 /// <summary>
 /// Gets a string representation of the column definition.
 /// </summary>
 ///
 /// <returns>
 /// A colon separated list of the fields that make up the column definition.
 /// </returns>
 ///
 public override string ToString()
 {
     return
         (string.Join(
              ":",
              new string[]
     {
         ColumnName,
         Caption,
         ColumnTypeName,
         ColumnWidth.ToString(),
         VisibleByDefault.ToString(),
         OrderBy
     }));
 }
Example #2
0
        public void ListCompleted()
        {
            _initialSelectLoad = false;
            CreateHtmlFromItems();

            var html = new StringBuilder();

            html.Append("<!DOCTYPE html>");
            html.Append("<html><head><meta charset=\"UTF-8\">");
            html.Append("<style>");
            html.Append(_fontFamiliesStyle);
            html.Append("</style>");
            html.Append("<script type='text/javascript'>");
            html.Append(" function fireEvent(name, data)");
            html.Append(" {");
            html.Append("   var event = new MessageEvent(name, {'data' : data});");
            html.Append("   document.dispatchEvent(event);");
            html.Append(" }");
            html.Append("</script>");
            html.Append("<style>");
            html.Append("ul { border: 0px solid black; display: inline-block; margin:0px; padding:0px; } ");
            html.Append("ul li { display: inline-block; list-style: none; vertical-align: top: } ");
            html.Append("ul li ul { border: 0px; padding: 0px; } ");
            html.AppendFormat("ul li ul li {{ cursor: pointer; display: list-item; white-space: nowrap; height:30px; list-style: none; text-align:left; width: {0}px; color:black; }} ", ColumnWidth.ToString());
            html.Append("ul li ul li.selected { color:blue; } ");
            html.Append("ul li ul li.hover { background-color: #CCCCCC; } ");
            html.Append("</style>");
            html.Append("</head>");
            html.AppendFormat("<body style='background:{0}; width:{1}; overflow-x:hidden' id='mainbody'><ul id='main'></ul>",
                              System.Drawing.ColorTranslator.ToHtml(BackColor),
                              this.Width);

            // The following line is removed at this point and done later as a change to the inner
            // html because otherwise the browser blows up because of the length of the
            // navigation line.  Leaving this and this comment in as a warning to anyone who
            // may be tempted to try the same thing.
            html.Append("</body></html>");
            SetHtml(html.ToString());
        }