////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region IDebugStackFrame2 Members

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public virtual int EnumProperties(enum_DEBUGPROP_INFO_FLAGS requestedFields, uint radix, ref Guid guidFilter, uint timeout, out uint elementsReturned, out IEnumDebugPropertyInfo2 enumDebugProperty)
        {
            //
            // Creates an enumerator for properties associated with the stack frame, such as local variables.
            //

            LoggingUtils.PrintFunction();

            try
            {
                uint numEnumeratedProperties;

                IEnumDebugPropertyInfo2 enumeratedProperties;

                LoggingUtils.RequireOk(m_property.EnumChildren(requestedFields, radix, ref guidFilter, enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_ALL, string.Empty, timeout, out enumeratedProperties));

                LoggingUtils.RequireOk(enumeratedProperties.GetCount(out numEnumeratedProperties));

                elementsReturned = numEnumeratedProperties;

                enumDebugProperty = enumeratedProperties;

#if false
                //List<DEBUG_PROPERTY_INFO> filteredProperties;

                if ((guidFilter == DebuggeeProperty.Filters.guidFilterRegisters) ||
                    (guidFilter == DebuggeeProperty.Filters.guidFilterAutoRegisters))
                {
                    //
                    // Registers must be specified in a collection/list as children of a 'CPU' property.
                    //

                    DEBUG_PROPERTY_INFO [] debugProperties = new DEBUG_PROPERTY_INFO [numEnumeratedProperties];

                    LoggingUtils.RequireOk(enumeratedProperties.Next(numEnumeratedProperties, debugProperties, out numEnumeratedProperties));

                    DebuggeeProperty registersProperty = new DebuggeeProperty(m_debugEngine, this, "CPU", string.Empty);

                    for (uint i = 0; i < numEnumeratedProperties; ++i)
                    {
                        DebuggeeProperty register;

                        if (m_stackRegisters.TryGetValue(debugProperties [i].bstrName, out register))
                        {
                            registersProperty.AddChildren(new DebuggeeProperty [] { register });
                        }
                    }

                    DEBUG_PROPERTY_INFO [] infoArray = new DEBUG_PROPERTY_INFO [1];

                    LoggingUtils.RequireOk(registersProperty.GetPropertyInfo(requestedFields, radix, timeout, null, 0, infoArray));

                    elementsReturned = (uint)infoArray.Length;

                    enumDebugProperty = new DebuggeeProperty.Enumerator(infoArray);
                }

                /*DEBUG_PROPERTY_INFO [] debugProperties = new DEBUG_PROPERTY_INFO [numProperties];
                 *
                 * LoggingUtils.RequireOk (enumeratedProperties.Next (numProperties, debugProperties, out numProperties));
                 *
                 * if ((guidFilter == DebuggeeProperty.Filters.guidFilterRegisters) || (guidFilter == DebuggeeProperty.Filters.guidFilterAutoRegisters))
                 * {
                 * //
                 * // Registers must be specified in a collection/list as children of a 'CPU' property.
                 * //
                 *
                 * DebuggeeProperty registersProperty = new DebuggeeProperty (m_debugEngine, this, "CPU", string.Empty);
                 *
                 * for (uint i = 0; i < numProperties; ++i)
                 * {
                 *  DebuggeeProperty register;
                 *
                 *  if (m_stackRegisters.TryGetValue (debugProperties [i].bstrName, out register))
                 *  {
                 *    registersProperty.AddChildren (new DebuggeeProperty [] { register });
                 *  }
                 * }
                 *
                 * DEBUG_PROPERTY_INFO [] infoArray = new DEBUG_PROPERTY_INFO [1];
                 *
                 * LoggingUtils.RequireOk (registersProperty.GetPropertyInfo (requestedFields, radix, timeout, null, 0, infoArray));
                 *
                 * filteredProperties = new List<DEBUG_PROPERTY_INFO> (1);
                 *
                 * filteredProperties.Add (infoArray [0]);
                 * }
                 * else
                 * {
                 * filteredProperties = new List<DEBUG_PROPERTY_INFO> ((int)numProperties);
                 *
                 * for (uint i = 0; i < numProperties; ++i)
                 * {
                 *  //
                 *  // Determine whether this property should be filtered in/out.
                 *  //
                 *
                 *  bool displayProperty = false;
                 *
                 *  DEBUG_PROPERTY_INFO prop = debugProperties [i];
                 *
                 *  if ((guidFilter == DebuggeeProperty.Filters.guidFilterAllLocals)
                 || (guidFilter == DebuggeeProperty.Filters.guidFilterAllLocalsPlusArgs))
                 || {
                 ||   displayProperty |= true;
                 || }
                 ||
                 || if ((guidFilter == DebuggeeProperty.Filters.guidFilterArgs)
                 || (guidFilter == DebuggeeProperty.Filters.guidFilterAllLocalsPlusArgs)
                 || (guidFilter == DebuggeeProperty.Filters.guidFilterLocalsPlusArgs))
                 || {
                 ||   displayProperty |= m_stackArguments.ContainsKey (prop.bstrName);
                 || }
                 ||
                 || if ((guidFilter == DebuggeeProperty.Filters.guidFilterAllLocals)
                 || (guidFilter == DebuggeeProperty.Filters.guidFilterAllLocalsPlusArgs)
                 || (guidFilter == DebuggeeProperty.Filters.guidFilterLocals)
                 || (guidFilter == DebuggeeProperty.Filters.guidFilterLocalsPlusArgs))
                 || {
                 ||   displayProperty |= m_stackLocals.ContainsKey (prop.bstrName);
                 || }
                 ||
                 || if (displayProperty)
                 || {
                 ||   filteredProperties.Add (prop);
                 || }
                 ||}
                 ||}*/
#endif

                return(Constants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                elementsReturned = 0;

                enumDebugProperty = null;

                return(Constants.E_FAIL);
            }
        }