コード例 #1
0
        private async void ReloadTagTypesAsync()
        {
            await ReloadTagTypesAsyncSemaphore.WaitAsync();

            try
            {
                if (_tagTypesLoaded)
                {
                    return;
                }

                var tagTypes = await ReloadTagTypesTask();

                TagTypes.Clear();
                foreach (var tagType in tagTypes)
                {
                    TagTypes.Add(tagType);
                }

                _tagTypesLoaded = true;
            }
            catch (Exception e)
            {
                TagTypesLoadFail(e);
            }
            finally
            {
                ReloadTagTypesAsyncSemaphore.Release();
            }
        }