// Update the appearance of a given breakpoint to show the given type. public void UpdateBreakpoint(SourceLocation sourceLocation, BreakpointTypes newBreakpointType) { ModelItem modelItem = this.GetModelItemFromSourceLocation(sourceLocation); if (modelItem != null) { SetBreakpointType(modelItem, newBreakpointType); } else { BreakpointTypes oldBreakpointType; if (this.unmappedBreakpoints.TryGetValue(sourceLocation, out oldBreakpointType)) { if (newBreakpointType == BreakpointTypes.None) { this.unmappedBreakpoints.Remove(sourceLocation); } else { this.unmappedBreakpoints[sourceLocation] = newBreakpointType; } } else if (newBreakpointType != BreakpointTypes.None) { this.unmappedBreakpoints.Add(sourceLocation, newBreakpointType); } } }
bool IsBreakpointOfType(ModelItem modelItem, BreakpointTypes breakpointType) { bool result = false; BreakpointTypes actualBreakpointType; TryActivateAllUnmappedBreakpoints(); if (this.breakpoints.TryGetValue(modelItem, out actualBreakpointType)) { result = (actualBreakpointType & breakpointType) > 0; } return(result); }
void SetBreakpointType(ModelItem modelItem, BreakpointTypes newBreakpointType) { BreakpointTypes oldBreakpointType = BreakpointTypes.None; if (this.breakpoints.TryGetValue(modelItem, out oldBreakpointType)) { Fx.Assert(oldBreakpointType != BreakpointTypes.None, "Should not store BreakpointType.None"); if (newBreakpointType == BreakpointTypes.None) { this.breakpoints.Remove(modelItem); } else { this.breakpoints[modelItem] = newBreakpointType; } } else if (newBreakpointType != BreakpointTypes.None) { this.breakpoints.Add(modelItem, newBreakpointType); } // Now notifying corresponding properties. if ((oldBreakpointType & BreakpointTypes.Bounded) != (newBreakpointType & BreakpointTypes.Bounded)) { this.isBreakpointBoundedProperty.NotifyPropertyChanged(modelItem); } if ((oldBreakpointType & BreakpointTypes.Enabled) != (newBreakpointType & BreakpointTypes.Enabled)) { this.isBreakpointEnabledProperty.NotifyPropertyChanged(modelItem); } if ((oldBreakpointType & BreakpointTypes.Conditional) != (newBreakpointType & BreakpointTypes.Conditional)) { this.isBreakpointConditionalProperty.NotifyPropertyChanged(modelItem); } }
// Inserting a new breakpoint of a given type. public void InsertBreakpoint(SourceLocation sourceLocation, BreakpointTypes breakpointType) { this.UpdateBreakpoint(sourceLocation, breakpointType); }
bool IsBreakpointOfType(ModelItem modelItem, BreakpointTypes breakpointType) { bool result = false; BreakpointTypes actualBreakpointType; TryActivateAllUnmappedBreakpoints(); if (this.breakpoints.TryGetValue(modelItem, out actualBreakpointType)) { result = (actualBreakpointType & breakpointType) > 0; } return result; }