private PrefixContainer GetOrCreatePrefixContainer()
        {
            if (_prefixContainer == null)
            {
                _prefixContainer = new PrefixContainer(_values.Keys);
            }

            return(_prefixContainer);
        }
Example #2
0
        private async Task <PrefixContainer> GetPrefixContainerAsync()
        {
            if (_prefixContainer == null)
            {
                // Initialization race is OK providing data remains read-only and object identity is not significant
                var collection = await GetValueCollectionAsync();

                _prefixContainer = new PrefixContainer(collection.Keys);
            }
            return(_prefixContainer);
        }
Example #3
0
        private async Task <PrefixContainer> GetPrefixContainerAsync()
        {
            if (_prefixContainer == null)
            {
                var dictionary = await GetDictionary();

                // Initialization race is OK providing data remains read-only and object identity is not significant.
                _prefixContainer = new PrefixContainer(dictionary.Keys);
            }

            return(_prefixContainer);
        }
Example #4
0
 public Task <bool> ContainsPrefixAsync(string prefix)
 {
     return(Task.FromResult(PrefixContainer.IsPrefixMatch(prefix, Name)));
 }
Example #5
0
 public bool ContainsPrefix(string prefix)
 {
     return(PrefixContainer.IsPrefixMatch(prefix, Key));
 }