static ContentTypeAttribute() { ContentTypeAttribute[] types = System.Enum.GetValues(typeof(ContentType)) .toArray <ContentType>().getArray(value => AutoCSer.EnumAttribute <ContentType, ContentTypeAttribute> .Array((int)value)); contentTypes = new AutoCSer.StateSearcher.AsciiSearcher <byte[]>(types.getArray(value => value.ExtensionName), types.getArray(value => value.Name.getBytes()), true); unknownContentType = contentTypes.Get("*"); Mp3 = contentTypes.Get("mp3", unknownContentType); Mp4 = contentTypes.Get("mp4", unknownContentType); Rmvb = contentTypes.Get("rmvb", unknownContentType); Doc = contentTypes.Get("doc", unknownContentType); Woff = contentTypes.Get("woff", unknownContentType); Gif = contentTypes.Get("gif", unknownContentType); Swf = contentTypes.Get("swf", unknownContentType); Pdf = contentTypes.Get("pdf", unknownContentType); Otf = contentTypes.Get("otf", unknownContentType); Jpeg = contentTypes.Get("jpeg", unknownContentType); Jpg = contentTypes.Get("jpg", unknownContentType); Png = contentTypes.Get("png", unknownContentType); Mpg = contentTypes.Get("mpg", unknownContentType); Svg = contentTypes.Get("svg", unknownContentType); Avi = contentTypes.Get("avi", unknownContentType); Apk = contentTypes.Get("apk", unknownContentType); Xml = contentTypes.Get("xml", unknownContentType); Rm = contentTypes.Get("rm", unknownContentType); Ico = contentTypes.Get("ico", unknownContentType); Zip = contentTypes.Get("zip", unknownContentType); Bmp = contentTypes.Get("bmp", unknownContentType); Rar = contentTypes.Get("rar", unknownContentType); Cur = contentTypes.Get("cur", unknownContentType); Css = contentTypes.Get("css", unknownContentType); Xls = contentTypes.Get("xls", unknownContentType); Txt = contentTypes.Get("txt", unknownContentType); Eot = contentTypes.Get("eot", unknownContentType); Wav = contentTypes.Get("wav", unknownContentType); Wmv = contentTypes.Get("wmv", unknownContentType); Docx = contentTypes.Get("docx", unknownContentType); Xlsx = contentTypes.Get("xlsx", unknownContentType); _7z = contentTypes.Get("7z", unknownContentType); }
internal static byte[] Get(string extensionName) { return(contentTypes.Get(extensionName, unknownContentType)); }