Exemplo n.º 1
0
        private async Task <BreakpointActionResult> SafeRaiseBreakpointChanged(Breakpoint breakpoint, BreakpointState breakpointState)
        {
            var result = new BreakpointActionResult();

            try
            {
                var changingEventArgs = new BreakpointChangingEventArgs(breakpoint, breakpointState);
                _debuggerView.RaiseBreakpointChanging(changingEventArgs);
                result = await changingEventArgs.SetBreakpointTask;

                if (result.IsSuccessful)
                {
                    if (breakpointState == BreakpointState.Added)
                    {
                        breakpoint.Identifier = result.BreakpointIdentifier;
                    }

                    _debuggerView.RaiseBreakpointChanged(new BreakpointChangedEventArgs(breakpoint, breakpointState, GetBreakpointData(breakpoint)));
                }
            }
            catch (Exception exception)
            {
                Messages.ShowError(exception.Message);
            }

            return(result);
        }
Exemplo n.º 2
0
		internal void RaiseBreakpointChanging(BreakpointChangingEventArgs args)
		{
			BreakpointChanging?.Invoke(this, args);
		}
Exemplo n.º 3
0
		private async Task<BreakpointActionResult> SafeRaiseBreakpointChanged(Breakpoint breakpoint, BreakpointState breakpointState)
		{
			var result = new BreakpointActionResult();

			try
			{
				var changingEventArgs = new BreakpointChangingEventArgs(breakpoint, breakpointState);
				_debuggerView.RaiseBreakpointChanging(changingEventArgs);
				result = await changingEventArgs.SetBreakpointTask;

				if (result.IsSuccessful)
				{
					if (breakpointState == BreakpointState.Added)
					{
						breakpoint.Identifier = result.BreakpointIdentifier;
					}

					_debuggerView.RaiseBreakpointChanged(new BreakpointChangedEventArgs(breakpoint, breakpointState, GetBreakpointData(breakpoint)));
				}
			}
			catch (Exception exception)
			{
				Messages.ShowError(exception.Message);
			}

			return result;
		}
Exemplo n.º 4
0
		private void CodeViewerBreakpointChangingHandler(object sender, BreakpointChangingEventArgs args)
		{
			var debuggerView = (DebuggerTabItem)sender;
			var breakpoint = args.Breakpoint;

			switch (args.State)
			{
				case BreakpointState.Added:
					args.SetBreakpointTask = _debuggerSession.SetBreakpoint(debuggerView.ProgramItem.ProgramIdentifier, breakpoint.Anchor.Line, CancellationToken.None);
					break;
				case BreakpointState.Enabled:
					args.SetBreakpointTask = _debuggerSession.EnableBreakpoint(breakpoint.Identifier, CancellationToken.None);
					break;
				case BreakpointState.Disabled:
					args.SetBreakpointTask = _debuggerSession.DisableBreakpoint(breakpoint.Identifier, CancellationToken.None);
					break;
				case BreakpointState.Removed:
					args.SetBreakpointTask = _debuggerSession.DeleteBreakpoint(breakpoint.Identifier, CancellationToken.None);
					break;
			}
		}