TimeZoneFactorySearchLocalizedNamesAsync Method

Performs a progressive (type-ahead) search for zones whose localized display name, exemplar city, or TZDB ID matches query.

Definition

Namespace: InnerDrive.TimeZones
Assembly: InnerDrive.TimeZones (in InnerDrive.TimeZones.dll) Version: 5.3.9728.0
C#
public Task<IReadOnlyList<LocalizedZoneName>> SearchLocalizedNamesAsync(
	string? query,
	CultureInfo? culture = null,
	TimeZoneNameStyle style = TimeZoneNameStyle.Location,
	int maxResults = 10,
	CancellationToken cancellationToken = default
)

Parameters

query  String
The user's in-progress search text.
culture  CultureInfo  (Optional)
The culture to search and resolve display names in. If null, CurrentUICulture is used.
style  TimeZoneNameStyle  (Optional)
The TimeZoneNameStyle to resolve.
maxResults  Int32  (Optional)
The maximum number of results to return. A value of zero or less returns every match.
cancellationToken  CancellationToken  (Optional)
A CancellationToken controlling the request lifetime

Return Value

TaskIReadOnlyListLocalizedZoneName
An empty list if query, once trimmed, has fewer text elements than timeZoneSettings:searchMinimumLength (default 3); otherwise the matches, relevance-ranked, capped at maxResults.

Implements

ITimeZoneFactorySearchLocalizedNamesAsync(String, CultureInfo, TimeZoneNameStyle, Int32, CancellationToken)

Remarks

The length check happens before initialization is ensured or any index is built, so sub-threshold keystrokes are inexpensive. The per-locale search index is built lazily on the first qualifying search and is rebuilt after Clear, after a reload, and once older than timeZoneSettings:searchIndexLifetimeSeconds (default 3600).

See Also