Exemplo n.º 1
0
        public ActionResult ViewNamespace(string @namespace)
        {
            HelpPermissions.ViewHelp.AssertAuthorized();

            NamespaceHelp model = HelpLogic.GetNamespaceHelp(@namespace);

            return(View(HelpClient.ViewNamespaceUrl, model));
        }
Exemplo n.º 2
0
    public static SearchResult?Search(this NamespaceHelp nh, Regex regex)
    {
        {
            Match m = regex.Match(nh.Title.RemoveDiacritics());
            if (m.Success)
            {
                return(new SearchResult(TypeSearchResult.Namespace, nh.Title, nh.Description.Try(d => d.Etc(etcLength)).DefaultText(nh.Title), m, nh.Namespace));
            }
        }

        if (nh.Description.HasText())
        {
            Match m = regex.Match(nh.Description.RemoveDiacritics());
            if (m.Success)
            {
                return(new SearchResult(TypeSearchResult.Namespace, nh.Title, nh.Description.Extract(m), m, nh.Namespace, isDescription: true));
            }
        }

        return(null);
    }