private string BuildContent(IComponent component) { string host = ContextHelper.GetHostUrl(); BaseTableComponent cp = component as BaseTableComponent; StringBuilder content = new StringBuilder(); content.AppendLine("<div class=\"main-content-inner\">"); content.AppendLine("<div class=\"breadcrumbs\" id=\"breadcrumbs\">"); content.AppendLine(" <script type=\"text/javascript\">"); content.AppendLine(" try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }"); content.AppendLine("</script>"); content.AppendLine("<ul class=\"breadcrumb\">"); content.AppendLine(" <li>"); content.AppendLine("<i class=\"ace-icon fa fa-home home-icon\"></i>"); content.AppendLine("<a href=\"" + host + "\">Components</a>"); content.AppendLine("</li>"); content.AppendFormat("<li class=\"active\" >{0}</li>", component.GetID()); content.AppendLine(" </ul>"); content.AppendLine(" </div>"); content.AppendLine("<div class=\"page-content\">"); content.AppendLine("<table class=\"table table-striped table-bordered table-hover\">"); //content.AppendLine("<colgroup>"); //content.AppendLine("<col style=\"width: 120px; \">"); //content.AppendLine("<col style=\"width: 120px; \">"); //content.AppendLine("<col />"); //content.AppendLine("</colgroup>"); List<TypeAttribute> componentList = cp.GetComponentList(); if (componentList != null) { IModel m = new TableModel(); BaseCptEntity cpt = m.ToModel("", "", componentList); TableEntity table = cpt as TableEntity; foreach (List<string> list in table.Value) { content.Append(CreateItem(list)); } } content.AppendLine("</table>"); content.AppendLine("</div>"); content.AppendLine("</div>"); return content.ToString(); }
public void Register(IComponent component) { VenusContainerLoader.Container.Define(typeof(IComponent), component.GetType(), component.GetID()); }