public TypeHelpTS GetTypeHelp(string typeName, TypeHelpMode mode) { Type type = TypeLogic.TryGetType(typeName); if (type == null) { return(null); } var isEnum = EnumEntity.IsEnumEntity(type); var members = new List <TypeMemberHelpTS>(); if (isEnum) { var enumType = EnumEntity.Extract(type); var values = EnumEntity.GetValues(enumType).ToList(); members.AddRange(values.Select(ev => new TypeMemberHelpTS(ev))); } else { var routes = PropertyRoute.GenerateRoutes(type); var root = TreeHelper.ToTreeC(routes, a => a.Parent).SingleEx(); members = root.Children .Where(a => mode == TypeHelpMode.CSharp || ReflectionServer.InTypeScript(a.Value)) .Select(pr => new TypeMemberHelpTS(pr, mode)).ToList(); if (mode == TypeHelpMode.CSharp) { var expressions = DynamicQueryManager.Current.RegisteredExtensions.GetValue(type); members.AddRange(expressions.Values.Select(ex => new TypeMemberHelpTS(ex))); } } return(new TypeHelpTS { type = (isEnum ? EnumEntity.Extract(type).Name : type.Name), cleanTypeName = typeName, isEnum = isEnum, members = members }); }