示例#1
0
        /// <summary>
        /// Gets value for filter <paramref name="filter"/>.
        /// </summary>
        /// <param name="filter"></param>
        /// <returns>value of the filter.</returns>
        /// <exception cref="ArgumentException">when <paramref name="filter"/> is not among <see cref="AppliedFilters"/>.</exception>
        internal string GetFilterValue(FilterOptionDefinition filter)
        {
            if (!_filters.ContainsKey(filter))
            {
                throw new ArgumentException($"{nameof(filter)} is not available in parse result.", nameof(filter));
            }

            return(_filters[filter].GetValueOrDefault <string>() ?? string.Empty);
        }
示例#2
0
 protected override Option GetFilterOption(FilterOptionDefinition def)
 {
     return(ParentCommand.LegacyFilters[def]);
 }
示例#3
0
 /// <summary>
 /// Gets token name used for filter <paramref name="filter"/>.
 /// </summary>
 /// <param name="filter"></param>
 /// <returns>Token or null when token cannot be evaluated.</returns>
 internal string?GetFilterToken(FilterOptionDefinition filter)
 {
     return(_filters[filter].Token?.Value);
 }