Esempio n. 1
0
        public async Task <EnumCollection> GetListedValuesAsync()
        {
            using (JoinableCollection.Join())
            {
                EnumCollectionProjectValue snapshot = await SourceBlock.ReceiveAsync();

                return(snapshot.Value);
            }
        }
Esempio n. 2
0
        public async Task <EnumCollection> GetListedValuesAsync()
        {
            if (!IsReadyToBuild())
            {
                throw new InvalidOperationException("This configuration is not set to build");
            }

            // NOTE: This has a race, if called off the UI thread, the configuration could become
            // inactive underneath us and hence not ready for build, causing below to block forever.

            using (JoinableCollection.Join())
            {
                EnumCollectionProjectValue snapshot = await SourceBlock.ReceiveAsync();

                return(snapshot.Value);
            }
        }
        public async Task <EnumCollection> GetListedValuesAsync()
        {
            if (!IsReadyToBuild())
            {
                throw new InvalidOperationException("This configuration is not set to build");
            }

            // NOTE: This has a race, if called off the UI thread, the configuration could become
            // inactive underneath us and hence not ready for build, causing below to block forever.

            using (JoinableCollection.Join())
            {
                EnumCollectionProjectValue snapshot = await SourceBlock.ReceiveAsync();

                // TODO: This is a hotfix for item ordering. Remove this OrderBy when completing: https://github.com/dotnet/project-system/issues/7025
                return(snapshot.Value.OrderBy(e => e.DisplayName).ToArray());
            }
        }