コード例 #1
0
        IBreakpoint IComponentWithBreakpoints.CreateBreakpoint(string breakpointType)
        {
            if (String.Equals(breakpointType, MemoryBreakpoint.BreakpointType, StringComparison.Ordinal))
            {
                MemoryBreakpoint bp = new MemoryBreakpoint(this);
                bp.PropertyChanged += this.OnBreakpointPropertyChanged;
                this.disabledBreakpoints.Add(bp);

                return(bp);
            }

            throw new NotSupportedException("'{0}' is not a supported breakpoint type!".FormatCurrentCulture(breakpointType));
        }
コード例 #2
0
        void IComponentWithBreakpoints.DeleteBreakpoint(IBreakpoint breakpoint)
        {
            MemoryBreakpoint bp = breakpoint as MemoryBreakpoint;

            if (bp != null)
            {
                bp.PropertyChanged -= this.OnBreakpointPropertyChanged;

                this.disabledBreakpoints.Remove(bp);
                this.readBreakpoints.Remove(bp);
                this.writeBreakpoints.Remove(bp);

                this.readBreakpointsArray  = this.readBreakpoints.ToArray();
                this.writeBreakpointsArray = this.writeBreakpoints.ToArray();
            }
        }
コード例 #3
0
        private void OnBreakpointPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            MemoryBreakpoint bp = sender as MemoryBreakpoint;

            if (bp != null)
            {
                switch (e.PropertyName)
                {
                case nameof(IMemoryBreakpoint.AccessType):
                case nameof(IMemoryBreakpoint.Enabled):
                    this.disabledBreakpoints.Remove(bp);
                    this.readBreakpoints.Remove(bp);
                    this.writeBreakpoints.Remove(bp);

                    if (bp.Enabled)
                    {
                        if ((bp.AccessType & AccessType.Read) == AccessType.Read)
                        {
                            this.readBreakpoints.Add(bp);
                        }

                        if ((bp.AccessType & AccessType.Write) == AccessType.Write)
                        {
                            this.writeBreakpoints.Add(bp);
                        }
                    }
                    else
                    {
                        this.disabledBreakpoints.Add(bp);
                    }

                    this.readBreakpointsArray  = this.readBreakpoints.ToArray();
                    this.writeBreakpointsArray = this.writeBreakpoints.ToArray();

                    break;
                }
            }
        }