Exemplo n.º 1
0
 internal override IEnumerable <HelpInfo> SearchHelp(
     HelpRequest helpRequest,
     bool searchOnlyContent)
 {
     using (AliasHelpProvider.tracer.TraceMethod())
     {
         if (!searchOnlyContent)
         {
             string target  = helpRequest.Target;
             string pattern = target;
             if (!WildcardPattern.ContainsWildcardCharacters(target))
             {
                 // ISSUE: reference to a compiler-generated field
                 this.\u003Cpattern\u003E5__a += "*";
             }
             WildcardPattern matcher = new WildcardPattern(pattern, WildcardOptions.IgnoreCase);
             IDictionary <string, AliasInfo> aliasTable = this._sessionState.Internal.GetAliasTable();
             foreach (string key in (IEnumerable <string>)aliasTable.Keys)
             {
                 if (matcher.IsMatch(key))
                 {
                     HelpRequest exactMatchHelpRequest = helpRequest.Clone();
                     exactMatchHelpRequest.Target = key;
                     foreach (HelpInfo helpInfo in this.ExactMatchHelp(exactMatchHelpRequest))
                     {
                         if (AliasHelpProvider.Match(helpInfo, helpRequest))
                         {
                             yield return(helpInfo);
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 private static bool Match(string target, string[] patterns)
 {
     if (patterns == null || patterns.Length == 0)
     {
         return(true);
     }
     foreach (string pattern in patterns)
     {
         if (AliasHelpProvider.Match(target, pattern))
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
 private static bool Match(HelpInfo helpInfo, HelpRequest helpRequest) => helpRequest == null || (helpRequest.HelpCategory & helpInfo.HelpCategory) != HelpCategory.None && AliasHelpProvider.Match(helpInfo.Component, helpRequest.Component) && (AliasHelpProvider.Match(helpInfo.Role, helpRequest.Role) && AliasHelpProvider.Match(helpInfo.Functionality, helpRequest.Functionality));