/// <summary> /// Used by a smart host to delegate the <see cref="IDebugDocumentContext.EnumCodeContexts"/> method /// </summary> /// <param name="sourceContext">The source context as provided to /// <see cref="IActiveScriptParse32.ParseScriptText"/> or /// <see cref="IActiveScriptParse32.AddScriptlet"/></param> /// <param name="offset">Character offset relative to start of script text</param> /// <param name="length">Number of characters in this context</param> /// <param name="enumContexts">An enumerator of the code contexts in the specified range</param> public void EnumCodeContextsOfPosition(UIntPtr sourceContext, uint offset, uint length, out IEnumDebugCodeContexts enumContexts) { uint result; if (_is64Bit) { var del = ComHelpers.GetMethodDelegate <RawEnumCodeContextsOfPosition64>(_pActiveScriptDebug64, 5); result = del(_pActiveScriptDebug64, sourceContext.ToUInt64(), offset, length, out enumContexts); } else { var del = ComHelpers.GetMethodDelegate <RawEnumCodeContextsOfPosition32>(_pActiveScriptDebug32, 5); result = del(_pActiveScriptDebug32, sourceContext.ToUInt32(), offset, length, out enumContexts); } ComHelpers.HResult.Check(result); }