/// <summary>
        /// Creates an instance of the BreakpointDetails class from a
        /// PowerShell Breakpoint object.
        /// </summary>
        /// <param name="breakpoint">The Breakpoint instance from which details will be taken.</param>
        /// <param name="updateType">The BreakpointUpdateType to determine if the breakpoint is verified.</param>
        /// <returns>A new instance of the BreakpointDetails class.</returns>
        internal static BreakpointDetails Create(
            Breakpoint breakpoint,
            BreakpointUpdateType updateType = BreakpointUpdateType.Set)
        {
            Validate.IsNotNull("breakpoint", breakpoint);

            if (!(breakpoint is LineBreakpoint lineBreakpoint))
            {
                throw new ArgumentException(
                          "Unexpected breakpoint type: " + breakpoint.GetType().Name);
            }

            var breakpointDetails = new BreakpointDetails
            {
                Id           = breakpoint.Id,
                Verified     = updateType != BreakpointUpdateType.Disabled,
                Source       = lineBreakpoint.Script,
                LineNumber   = lineBreakpoint.Line,
                ColumnNumber = lineBreakpoint.Column,
                Condition    = lineBreakpoint.Action?.ToString()
            };

            if (lineBreakpoint.Column > 0)
            {
                breakpointDetails.ColumnNumber = lineBreakpoint.Column;
            }

            return(breakpointDetails);
        }
 internal BreakpointUpdatedEventArgs(System.Management.Automation.Breakpoint breakpoint, BreakpointUpdateType updateType)
 {
     this.Breakpoint = breakpoint;
     this.UpdateType = updateType;
 }
Esempio n. 3
0
 public DebuggerBreakpointUpdatedEventArgs(PowerShellBreakpoint breakpoint, BreakpointUpdateType updateType)
 {
     Breakpoint = breakpoint;
     UpdateType = updateType;
 }
Esempio n. 4
0
 internal BreakpointUpdatedEventArgs(Breakpoint breakpoint, BreakpointUpdateType updateType)
 {
     this.breakpoint = breakpoint;
     this.updateType = updateType;
 }
Esempio n. 5
0
 internal BreakpointUpdatedEventArgs(System.Management.Automation.Breakpoint breakpoint, BreakpointUpdateType updateType)
 {
     this.Breakpoint = breakpoint;
     this.UpdateType = updateType;
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes the BreakpointUpdatedEventArgs 
 /// </summary>
 internal BreakpointUpdatedEventArgs(Breakpoint breakpoint, BreakpointUpdateType updateType, int breakpointCount)
 {
     this.Breakpoint = breakpoint;
     this.UpdateType = updateType;
     this.BreakpointCount = breakpointCount;
 }