//
        // IEnumerator interface
        //

        #region IEnumerator Members

        public bool MoveNext()
        {
            var  a = new ICorDebugBreakpoint[1];
            uint c = 0;
            int  r = m_enum.Next((uint)a.Length, a, out c);

            if (r == 0 && c == 1) // S_OK && we got 1 new element
            {
                ICorDebugBreakpoint br = a[0];
                throw new NotImplementedException();

                /*
                 * if(a is ICorDebugFunctionBreakpoint)
                 *  m_br = new CorFunctionBreakpoint((ICorDebugFunctionBreakpoint)br);
                 * else if( a is ICorDebugModuleBreakpoint)
                 *  m_br = new CorModuleBreakpoint((ICorDebugModuleBreakpoint)br);
                 * else if( a is ICorDebugValueBreakpoint)
                 *  m_br = new ValueBreakpoint((ICorDebugValueBreakpoint)m_br);
                 * else
                 *  Debug.Assert(false);
                 */
            }
            else
            {
                m_br = null;
            }
            return(m_br != null);
        }
        //
        // IEnumerator interface
        //

        #region IEnumerator Members

        public bool MoveNext()
        {
            var a = new ICorDebugBreakpoint[1];
            uint c = 0;
            int r = m_enum.Next((uint) a.Length, a, out c);
            if (r == 0 && c == 1) // S_OK && we got 1 new element
            {
                ICorDebugBreakpoint br = a[0];
                throw new NotImplementedException();
                /*
                if(a is ICorDebugFunctionBreakpoint)
                    m_br = new CorFunctionBreakpoint((ICorDebugFunctionBreakpoint)br);
                else if( a is ICorDebugModuleBreakpoint)
                    m_br = new CorModuleBreakpoint((ICorDebugModuleBreakpoint)br);
                else if( a is ICorDebugValueBreakpoint)
                    m_br = new ValueBreakpoint((ICorDebugValueBreakpoint)m_br);
                else
                    Debug.Assert(false);
                */
            }
            else
                m_br = null;
            return m_br != null;
        }
Exemple #3
0
 /// <summary>
 /// Register a handler to be invoked when a Custom Breakpoint is hit.
 /// </summary>
 /// <param name="breakpoint">The CorBreakpoint to register.</param>
 /// <param name="handler">The CustomBreakpointEventHandler to run when the Breakpoint is hit.
 /// 	If this is null, this breakpoints callback is explicitly deregistered.
 /// </param>
 /// <remarks>
 /// 	Only one handler can be specified per breakpoint. The handler could be a 
 /// 	multicast delegate. To change a breakpoints handler, first deregister it and then set
 /// 	a new one.
 /// 	The handler has the same lifespan semantics as the underlying CorBreakpoint object.
 /// 	That means it is alive and the same handler will be invoked every time the breakpoint is hit
 /// 	until the handler is explicitly deregistered. 
 ///
 /// 	A handler can stop the shell at the breakpoint by calling Controller.Stop on the
 ///		CustomBreakpointEventArgs parameter passed into the delegate.
 ///</remarks>
 public void RegisterCustomBreakpoint(CorBreakpoint breakpoint, CustomBreakpointEventHandler handler)
 {
     Debug.Assert(breakpoint != null);
     if (breakpoint == null)
         throw new ArgumentException("cannot be null", "breakpoint");
     if (handler == null)
     {
         // explicit deregistration
         if (customBreakpoints != null)
         {
             customBreakpoints.Remove(breakpoint);
         }
     }
     else
     {
         // adding registration
         if (customBreakpoints == null)
         {
             customBreakpoints = new ListDictionary();
         }
         else
         {
             if (customBreakpoints.Contains(breakpoint))
             {
                 throw new InvalidOperationException("Handler alrady registered for the custom breakpoint");
             }
         }
         customBreakpoints.Add(breakpoint, handler);
     }
 }
 public void Reset()
 {
     m_enum.Reset();
     m_br = null;
 }
 public CorBreakpointEventArgs(CorAppDomain appDomain,
                               CorThread thread,
                               CorBreakpoint managedBreakpoint,
                               ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_break = managedBreakpoint;
 }
 public CorBreakpointEventArgs(CorAppDomain appDomain,
                               CorThread thread,
                               CorBreakpoint managedBreakpoint)
     : base(appDomain, thread)
 {
     m_break = managedBreakpoint;
 }
 public CorBreakpointSetErrorEventArgs(CorAppDomain appDomain,
                                       CorThread thread,
                                       CorBreakpoint breakpoint,
                                       int errorCode,
                                       ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_breakpoint = breakpoint;
     m_errorCode = errorCode;
 }
 public CorBreakpointSetErrorEventArgs(CorAppDomain appDomain,
                                       CorThread thread,
                                       CorBreakpoint breakpoint,
                                       int errorCode)
     : base(appDomain, thread)
 {
     m_breakpoint = breakpoint;
     m_errorCode = errorCode;
 }
 public void Reset()
 {
     m_enum.Reset();
     m_br = null;
 }