コード例 #1
0
ファイル: FileUpload.cs プロジェクト: HarveyHuBJ/AK47Source
        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());
        }
コード例 #2
0
        private Control CreateContentTypesTable()
        {
            HtmlTable table = (HtmlTable)CreateContentTypesTableHead();

            foreach (ContentTypeConfigElement elem in ContentTypesSection.GetConfig().ContentTypes)
            {
                CreateOneElementRow(elem, table);
            }

            return(table);
        }
コード例 #3
0
ファイル: FileUpload.cs プロジェクト: HarveyHuBJ/AK47Source
        /// <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);
            }
        }
コード例 #4
0
        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);
        }