src/System.Management.Automation/help/GlossaryHelpProvider.cs
/// <summary>
/// This is for implementing CustomMatch algorithm to be used in 
/// HelpProviderWithCache for matching a help target with keys in 
/// help cache. 
/// 
/// For each glossary entry, it can contain multiple terms. The
/// key stored in help cache is a concatenation of keys. For example,
/// if there are two terms "foo" and "bar", the key to be used in 
/// help cache will be "foo, bar". 
///  
/// Because of this mangling, key "foo, bar" should match both 
/// "foo" and "bar".
/// 
/// </summary>
/// <param name="target">target to search</param>
/// <param name="key">key used in cache table</param>
/// <returns></returns>
This is for implementing CustomMatch algorithm to be used in
HelpProviderWithCache for matching a help target with keys in
help cache.

For each glossary entry, it can contain multiple terms. The
key stored in help cache is a concatenation of keys.


This is for implementing CustomMatch algorithm to be used in HelpProviderWithCache for matching a help target with keys in help cache . For each glossary entry it can contain multiple terms . The key stored in help cache is a concatenation of keys .
protected sealed override bool CustomMatch(string target, string key)
        {
            if (String.IsNullOrEmpty(target) || String.IsNullOrEmpty(key))
                return false;
            string[] terms = key.Split(Utils.Separators.Comma);
            for (int i = 0; i < terms.Length; i++)
            {
                string term = terms[i].Trim();
                if (term.Equals(target, StringComparison.OrdinalIgnoreCase))
                    return true;
            }
            return false;
        }
protected sealed override bool CustomMatch ( string target , string key ) { if ( String . IsNullOrEmpty ( target ) || String . IsNullOrEmpty ( key ) ) return false ; string [ ] terms = key . Split ( Utils . Separators . Comma ) ; for ( int i = 0 ; i < terms . Length ; i ++ ) { string term = terms [ i ] . Trim ( ) ; if ( term . Equals ( target , StringComparison . OrdinalIgnoreCase ) ) return true ; } return false ; }
This is for implementing CustomMatch algorithm to be used in
HelpProviderWithCache for matching a help target with keys in
help cache.
This is for implementing CustomMatch algorithm to be used in HelpProviderWithCache for matching a help target with keys in help cache .
None
target
string
target to search
target to search
key
string
key used in cache table
key used in cache table