internal static string GetOpenInlineFileExtensionNames() { StringBuilder sb = new StringBuilder(256); foreach (ContentTypeConfigElement elem in ContentTypesSection.GetConfig().ContentTypes) { if (sb.Length != 0 && sb[sb.Length - 1] != ',') { sb.Append(","); } if (elem.OpenMode == WebFileOpenMode.Inline) { for (int i = 0; i < elem.FileExtensionNames.Count; i++) { if (i != 0) { sb.Append(","); } sb.Append(elem.FileExtensionNames[i]); } } } return(sb.ToString()); }
private Control CreateContentTypesTable() { HtmlTable table = (HtmlTable)CreateContentTypesTableHead(); foreach (ContentTypeConfigElement elem in ContentTypesSection.GetConfig().ContentTypes) { CreateOneElementRow(elem, table); } return(table); }
/// <summary> /// 获得配置节点 /// </summary> /// <param name="originalName">文件名</param> /// <returns></returns> private static ContentTypeConfigElement GetConfigElement(string originalName) { ContentTypeConfigElement elem = ContentTypesSection.GetConfig().ContentTypes.FindElementByFileName(originalName); if (elem != null) { return(elem); } else { return(ContentTypesSection.GetConfig().DefaultElement); } }
protected void Page_Load(object sender, EventArgs e) { tableContainer.Controls.Add(CreateContentTypesTable()); ContentTypeConfigElement elem = ContentTypesSection.GetConfig().ContentTypes.FindElementByFileName("abc.ra"); HtmlTable table = (HtmlTable)CreateContentTypesTableHead(); CreateOneElementRow(elem, table); tableContainer.Controls.Add(table); table = (HtmlTable)CreateContentTypesTableHead(); CreateOneElementRow(ContentTypesSection.GetConfig().DefaultElement, table); tableContainer.Controls.Add(table); }