Пример #1
0
        // Enumerates the children of a property. This provides support for dereferencing pointers, displaying members of an array, or fields of a class or struct.
        // The sample debugger only supports pointer dereferencing as children. This means there is only ever one child.
        public int EnumChildren(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, ref System.Guid guidFilter, enum_DBG_ATTRIB_FLAGS dwAttribFilter, string pszNameFilter, uint dwTimeout, out IEnumDebugPropertyInfo2 ppEnum)
        {
            ppEnum = null;
            try {
                var children = TaskHelpers.RunSynchronouslyOnUIThread(ct => {
                    var timeoutToken = CancellationTokens.GetToken(TimeSpan.FromMilliseconds(dwTimeout));
                    var linkedSource = CancellationTokenSource.CreateLinkedTokenSource(ct, timeoutToken);
                    return(_evalResult.GetChildrenAsync(linkedSource.Token));
                });

                if (children != null)
                {
                    DEBUG_PROPERTY_INFO[] properties = new DEBUG_PROPERTY_INFO[children.Length];
                    for (int i = 0; i < children.Length; i++)
                    {
                        properties[i] = new AD7Property(_frame, children[i], true).ConstructDebugPropertyInfo(dwRadix, dwFields);
                    }
                    ppEnum = new AD7PropertyEnum(properties);
                    return(VSConstants.S_OK);
                }
                return(VSConstants.S_FALSE);
            } catch (OperationCanceledException) {
                return(VSConstants.S_FALSE);
            }
        }
Пример #2
0
        // Enumerates the children of a property. This provides support for dereferencing pointers, displaying members of an array, or fields of a class or struct.
        // The sample debugger only supports pointer dereferencing as children. This means there is only ever one child.
        public int EnumChildren(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, ref System.Guid guidFilter, enum_DBG_ATTRIB_FLAGS dwAttribFilter, string pszNameFilter, uint dwTimeout, out IEnumDebugPropertyInfo2 ppEnum)
        {
            ppEnum = null;
            var children = _evalResult.GetChildren((int)dwTimeout);

            if (children != null)
            {
                DEBUG_PROPERTY_INFO[] properties = new DEBUG_PROPERTY_INFO[children.Length];
                for (int i = 0; i < children.Length; i++)
                {
                    properties[i] = new AD7Property(_frame, children[i], true).ConstructDebugPropertyInfo(dwRadix, dwFields);
                }
                ppEnum = new AD7PropertyEnum(properties);
                return(VSConstants.S_OK);
            }
            return(VSConstants.S_FALSE);
        }