Esempio n. 1
0
        /// <summary>
        /// 获取当前类型实例。
        /// </summary>
        /// <param name="type">类型名称。</param>
        /// <returns>返回类型相关页面。</returns>
        public IActionResult OnGet(string type)
        {
            TypeDescriptor = AssemblyDocument.GetTypeDescriptor(type);
            if (TypeDescriptor == null)
            {
                return(NotFound());
            }
            AssemblyName = TypeDescriptor.Assembly.AssemblyName;
            Type         = Type.GetType($"{type}, {AssemblyName}", false, true);
            if (Type == null)
            {
                return(NotFound());
            }
            var index = type.LastIndexOf('.');

            TagName            = index > 0 ? type[index + 1] : type[0];
            ViewData["Title"]  = Type.GetRealTypeName();
            ViewData["IsDocs"] = true;
            PageContext.AddLibraries(ImportLibrary.Highlight | ImportLibrary.GtDocs);
            return(OnAfterGetted());
        }