Exemple #1
0
 public int EnumBoundBreakpoints(out IEnumDebugBoundBreakpoints2 boundBreakpointsEnum)
 {
     if (_newlyBoundBreakpoints != null && _breakpointBoundEnumFactory != null)
     {
         boundBreakpointsEnum = _breakpointBoundEnumFactory.Create(_newlyBoundBreakpoints);
     }
     else
     {
         _pendingBreakpoint.EnumBoundBreakpoints(out boundBreakpointsEnum);
     }
     return(VSConstants.S_OK);
 }
        public static IEnumerable <IDebugBoundBreakpoint2> EnumBoundBreakpoints(this IDebugPendingBreakpoint2 breakpoint)
        {
            Contract.Requires <ArgumentNullException>(breakpoint != null, "breakpoint");

            IEnumDebugBoundBreakpoints2 boundBreakpoints;

            ErrorHandler.ThrowOnFailure(breakpoint.EnumBoundBreakpoints(out boundBreakpoints));

            uint count;

            ErrorHandler.ThrowOnFailure(boundBreakpoints.GetCount(out count));

            IDebugBoundBreakpoint2[] breakpoints = new IDebugBoundBreakpoint2[count];
            uint fetched = 0;

            ErrorHandler.ThrowOnFailure(boundBreakpoints.Next(count, breakpoints, ref fetched));

            return(breakpoints.Take((int)fetched));
        }