Пример #1
0
        private async Task WatchingLoop(int indexOfDictionary, string keyPath)
        {
            var state = _source.CreateWatchState();

            try
            {
                while (true)
                {
                    var response = await _source.TryWatchKeysAsync(keyPath, state).ConfigureAwait(false);

                    if (!response.Success)
                    {
                        continue;
                    }

                    UpdateDictionaryInList(indexOfDictionary, response.Dictionary);
                    FireWatchers();
                }
            }
            catch (TaskCanceledException) { /* nom nom */ }
            catch (ObjectDisposedException) { /* nom nom */ }
        }