コード例 #1
0
ファイル: IconMargin.cs プロジェクト: xiaowuwang/SQLPad
        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);
        }
コード例 #2
0
		internal void RaiseBreakpointChanging(BreakpointChangingEventArgs args)
		{
			BreakpointChanging?.Invoke(this, args);
		}
コード例 #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;
		}
コード例 #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;
			}
		}