コード例 #1
0
        public async Task GetFirstNChildrenReturnsNElementsAsync()
        {
            const int numToFetch   = 2;
            var       propertyInfo = new DEBUG_PROPERTY_INFO[numToFetch];
            int       numFetched   = await _childrenProvider.GetChildrenAsync(0, numToFetch, propertyInfo);

            Assert.That(numFetched, Is.EqualTo(numToFetch));

            Assert.That(propertyInfo[0].bstrName, Is.EqualTo(_children[0].DisplayName));
            Assert.That(propertyInfo[1].bstrName, Is.EqualTo(_children[1].DisplayName));
        }
コード例 #2
0
        async Task <IListDebugPropertyInfo> GetPropertiesInfoAsync()
        {
            var propertyInfos = new DEBUG_PROPERTY_INFO[_requestedCount];
            int returned      =
                await _childrenProvider.GetChildrenAsync(_fromIndex, _requestedCount,
                                                         propertyInfos);

            return(new ListDebugPropertyInfo(propertyInfos.Take(returned).ToArray()));
        }
コード例 #3
0
        public int Next(uint count, DEBUG_PROPERTY_INFO[] outPropertyInfo, out uint numFetched)
        {
            numFetched = (uint)_taskExecutor.Run(async() =>
                                                 await _childrenProvider.GetChildrenAsync(
                                                     _childOffset, (int)count,
                                                     outPropertyInfo));

            _childOffset += (int)numFetched;
            return(numFetched == count ? VSConstants.S_OK : VSConstants.S_FALSE);
        }